I read other posts about the notorious _imaging C module error when installing PIL on Mac OS X, and none of the solutions provided anywhere, including the PIL FAQ, were helpful.
I have the latest versions of libjpeg and zlib recently installed from the source. I edited the Makefiles in each of them to include the -arch i386 parameter in the LD_FLAGS variable for 32-bit builds. PIL installs without any problems, and a brief installation description printed on the terminal suggests that support for JPEG, TIFF and PNG is fine. After that I try self-test:
new-host:Imaging-1.1.7 ely$ python selftest.py *** The _imaging C module is not installed
This is usually seen for a number of reasons. Knowing more deeply, here I am trying to import _imaging directly into python.
new-host:Imaging-1.1.7 ely$ python ActivePython 2.7.1.4 (ActiveState Software Inc.) based on Python 2.7.1 (r271:86832, Feb 7 2011, 11:33:10) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import PIL >>> import _imaging Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/_imaging.so, 2): Symbol not found: _jpeg_resync_to_restart Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/PIL/_imaging.so Expected in: dynamic lookup
Here again, "Symbol not found: _jpeg_resync_to_restart" is known and common, and many people have suggested that this is due to the wrong path to libjpeg. I checked again and again, and I only have libjpeg (as well as zlib, etc.) installed in my home directory, all in separate folders, from the source, and all this is correctly marked in the setup.py file.
So, PIL should get jpeg support (and zlib, etc.) from the right places. All dependencies are installed. I see _imaging.so in my sys.path, but I still get this _jpeg_resync_to_restart error.
Are there any ideas that are not related to alternative posts? I spent ~ 7 hours reading and trying to find possible solutions from the posts in each forum that I can find.