我已经无计可施了。我有一个可以正常工作的python 2.6.5和numpy和scipy的安装。我想用它来做一些简单的PCA,这需要导入图像。好吧,我想PIL是解决这个问题的方法。因此,我按照指南下载并安装了libjpeg6-b。然后,我使用了以下命令
tar zxvf jpegsrc.v6b.tar.gz
cd jpeg-6b
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
./configure --enable-shared --enable-static
make我转到我下载PIL 1.1.7的地方,并执行了以下操作:
tar zxvf Imaging-1.1.7.tar.gz
cd Imaging-1.1.7
(edit the setup.py file to find libjpeg)
python setup.py build
python setup.py install然后,我尝试导入_imaging,得到著名的ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.3-fat.egg/_imaging.so,2):找不到符号:从: /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.3-fat.egg/_imaging.so引用的_jpeg_resync_to_restart应在:动态查找错误。
我已经尝试了大部分/所有的解决方案,但没有找到太多成功的方法。在我将我的架构限制在i386上之后,我在我的_imaging.so上运行了otool,并得到了:
Thomas$ otool -L /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/PIL/_imaging.so:/usr/lib/libSystem.B.dylib (兼容性版本1.0.0,当前版本125.2.0)
此外,当我运行pip并获得以下输出时
--------------------------------------------------------------------
PIL 1.1.6 BUILD SUMMARY
--------------------------------------------------------------------
version 1.1.6
platform darwin 2.6.5 (r265:79359, Mar 24 2010, 01:32:55)
[GCC 4.0.1 (Apple Inc. build 5493)]
--------------------------------------------------------------------
--- TKINTER support ok
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
--------------------------------------------------------------------
To check the build, run the selftest.py script.对于PIL 1.1.6。
我试过切换到gcc 4.0,也编译了libjpeg和PIL。
任何帮助都将不胜感激。另外,如果您需要更多信息,请不要犹豫,尽管问。
发布于 2010-07-11 14:15:31
您还可以使用pip安装映像
安装pip的用户easy_install
easy_install管道
pip安装http://effbot.org/downloads/Imaging-1.1.6.tar.gz
或者,如果这对你没有帮助,我写了一篇关于如何让PIL、libjpeg、_imaging与python2.6和雪豹一起工作的文章。
http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/
发布于 2010-06-24 13:32:52
你知道Macports (或Fink)吗?安装软件和软件包的最简单方法是通过Macports。或者,您可以查看Macports的Portfiles,看看它们是如何编译这些库的。
https://stackoverflow.com/questions/3106893
复制相似问题