How do I build PIL on OS X Mountain Lion?

跟風遠走 提交于 2019-12-06 21:34:27

PIL does not keep up with support for new operating systems (by making changes to setup.py for new lib dirs, etc). But intstead of PIL, you can use the "friendly PIL fork" Pillow:

And if you get the same error, please report the issue:

Dolan Antenucci

From this SO question, I was able to find Python.h in /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7. (note that i have Xcode installed)

I then ran sudo python setup.py build_ext --include-dirs /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7:/Developer/SDKs/MacOSX10.7.sdk/usr/include

(note: /Developer/SDKs/MacOSX10.7.sdk/usr/include added because stdio.h was missing once the Python.h was resolved)

Finally, I ran sudo python setup.py install

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