Can't install PIL after Mac OS X 10.9

前端 未结 28 1025
长情又很酷
长情又很酷 2020-11-28 17:41

I\'ve just updated my Mac OS to 10.9 and I discovered that some (all?) of my Python modules are not here anymore, especially the Image one.

So I try to execute

相关标签:
28条回答
  • 2020-11-28 18:24

    Reusing @DmitryDemidenko's answer that is how it worked for me:

    ln -s  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers/X11 /usr/local/include/X11
    

    and then

    sudo pip install -U PIL --allow-external PIL --allow-unverified PIL
    
    0 讨论(0)
  • 2020-11-28 18:25

    I had a similar problem: Installing pillow failed with clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future], installing command line tools failed with Can't install the software because it is not currently available from the Software Update server., and even after installing the command line tools manually, the compilation of PIL failed.

    This happens cause clang under the newest version of xcode doesn't warn on unknown compiler flags, but rather stop the compilation with a hard error.

    To fix this, just run export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" on the terminal before trying to compile (installing pil).

    0 讨论(0)
  • 2020-11-28 18:27

    I was having the following error

    building 'PIL._imagingft' extension
    _imagingft.c:62:10: fatal error: 'freetype/fterrors.h' file not found
    
    #include <freetype/fterrors.h>
    
             ^
    
    1 error generated.
    
    error: command 'cc' failed with exit status 1
    

    The solution to this was to symlink freetype2 to freetype and this solved the problem.

    0 讨论(0)
  • 2020-11-28 18:27

    A more complete solution requires the installation of the Xquartz X11 subsystem that has been built outside of Apple for several years now. Here are the steps I used to get it all working

    1. Install XQuartz from http://xquartz.macosforge.org/landing/
    2. Run sudo pip install pillow
    0 讨论(0)
  • 2020-11-28 18:28
    ln -s /usr/local/include/freetype2 /usr/local/include/freetype
    sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pil
    
    0 讨论(0)
  • 2020-11-28 18:29

    Found the solution ... You've to symlink X11 like this ln -s /opt/X11/include/X11 /usr/local/include/X11 and then sudo pip install pil should work.

    0 讨论(0)
提交回复
热议问题