Pyinstaller troubles with Pillow

不羁岁月 提交于 2019-12-13 13:33:36

问题


I'm trying to use pyinstaller, on OSX Mavericks, with one a Python script. Pyinstaller compiles and packs along until it finds an error with the Pillow library.

ImportError: dlopen(/Users/Rodolphe/.python-eggs/Pillow-2.2.1-py2.7-macosx-10.9-intel.egg tmp/PIL/_imaging.so, 2): Library not loaded: /usr/local/lib/libjpeg.8.dylib
Referenced from: /Users/Rodolphe/.python-eggs/Pillow-2.2.1-py2.7-macosx-10.9-intel.egg-tmp/PIL/_imaging.so
Reason: Incompatible library version: _imaging.so requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0

It looks like Pyinstaller and Pillow are not getting along (it seems to be a known fact: http://www.pyinstaller.org/ticket/745 ). Is there a way around it? Should I try uninstalling Pillow and installing Pil instead (I chose Pillow out of discouragement from Pil's reluctancy to install on Mavericks, to begin with)? Or maybe update libjpeg.8.dylib to version 13.0.0 as it seems to be the problem?

[EDIT] I have updated libjepeg thanks to the advice from @mimi.vx I now have another error at the very end of the process:

IOError: [Errno 20] Not a directory: '/Library/Python/2.7/site-packages/Pillow-2.2.1-py2.7-macosx-10.9-intel.egg/PIL/_imaging.so'

I tried reinstalling Pillow so Pyinstaller would maybe get the directory, but no luck yet...

[RE-EDIT] Using py2app instead of pyinstaller worked for me!


回答1:


Yes, first try update libjpeg

Good help for OS X can be found in this blog http://brantsteen.com/blog/python-27-libjpeg-pil-on-osx/

libjpg latest source is here www.ijg.org

And Pillow recommended install on OS X is described in pypi.python.org/pypi/Pillow/2.2.1

It is over homebrew $ brew install libtiff libjpeg webp littlecms




回答2:


Pyinstaller was behaving strangely while importing PIL. I tried using py2app ( http://pythonhosted.org/py2app/ ) instead, and it worked like a charm. No lib ray import trouble or anything. I'd recommend it.



来源:https://stackoverflow.com/questions/20476837/pyinstaller-troubles-with-pillow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!