我試圖在Snow Leopard上安裝PIL,使用Python 2.6.1,GCC 4.2.1,PIL 1.1.7,並嘗試使用libjpeg6b和libjpeg7 - 沒有任何東西作品。我已經從fink中清除了libjpeg/pil/zlib的所有蹤跡,嘗試了各種編譯器選項等,並且使用了http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/和http:// www.brambraakman.com/blog/comments/installing_pil_in_snow_leopard_jpeg_resync_to_restart_error/(不是鏈接,因爲僅適用於StOv讓我發佈一個......)在雪豹上安裝PIL - 沒有作品
4的潛在有用的信息位:
OTOOL不顯示的libjpeg作爲一個依賴
otool -L /Library/Python/2.6/site-packages/PIL/_imaging.so
/Library/Python/2.6/site-packages/PIL/_imaging.so:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
我得到這些奇怪的編譯器消息
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: Tcl: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: -framework: linker input file unused because linking not done
i686-apple-darwin10-gcc-4.2.1: Tk: linker input file unused because linking not done
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/sw/include/freetype2 -I/sw/include -I/opt/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c Tk/tkImaging.c -o build/temp.macosx-10.6-universal-2.6/Tk/tkImaging.o -framework Tcl -framework Tk
In file included from /System/Library/Frameworks/Tk.framework/Headers/tk.h:78,
from Tk/tkImaging.c:51:
selftest.py失敗,因爲_imagingmath的(我用上面給出的第二個鏈接,之前太失敗了,由於_imaging後)
Themistocles:Imaging-1.1.7 me$ python selftest.py
Traceback (most recent call last):
File "selftest.py", line 11, in <module>
from PIL import ImageMath
File "./PIL/ImageMath.py", line 19, in <module>
import _imagingmath
ImportError: No module named _imagingmath
只要不是selftest.py失敗,因爲_imaging
>>> import _imaging
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Library/Python/2.6/site-packages/PIL/_imaging.so, 2): Symbol not found: _jpeg_resync_to_restart
Referenced from: /Library/Python/2.6/site-packages/PIL/_imaging.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/PIL/_imaging.so
的
請幫助!這太荒謬了。我甚至很樂意能夠在這一點上編譯PIL sans jpeg支持!
我應該刪除我已經安裝了的libjpeg/PIL的副本? – 2010-07-11 21:23:40
暫停,macports是否想要安裝它自己的Python,還是將它與系統之間的良好? – 2010-07-11 21:25:12
當我運行它時,我已經安裝了較新的python,所以我不完全確定。它可能需要重新安裝一些fink已有的東西,我從來沒有聯合使用過這兩個。 – eruciform 2010-07-11 21:32:26