Can't install PIL after Mac OS X 10.9

前端 未结 28 1022
长情又很酷
长情又很酷 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:15

    Works for me ( OS X Yosemite 10.10.2 - Python 2.7.9 ) :

    xcode-select --install
    sudo pip install pillow
    

    Try this to check it:

    from PIL import Image
    image = Image.open("file.jpg")
    image.show()
    
    0 讨论(0)
  • 2020-11-28 18:15

    installing command line tools fixed the issue for me

    you have to install them separately as they are not part of the packages in xcode now:

    https://developer.apple.com/downloads/index.action?=command%20line%20tools#

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

    My machine which was recently upgraded from OS 10.8 -> 10.9 got stuck in a loop between xcrun and lipo.

    Rename /usr/bin/lipo to /usr/bin/lipo_broken

    Refer to this thread for further information on how to resolve:

    xcrun/lipo freezes with OS X Mavericks and XCode 4.x

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

    Try this:

    ln -s /usr/local/include/freetype2 /usr/local/include/freetype
    
    0 讨论(0)
  • 2020-11-28 18:16

    That's what I did:

    First upgrade to Xcode 5 (I am running 10.9). Then, execute the following commands in a terminal:

    $ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
    $ 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/include/
    
    0 讨论(0)
  • 2020-11-28 18:16
    sudo pip uninstall pillow
    pip install pillow
    

    worked for me. I'm running Python 2.7.9 on Yosemite.import PIL now works for me.

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