Installing PIL on OS X Snow Leopard w/Xcode4 (no PPC support)

前端 未结 4 1579
借酒劲吻你
借酒劲吻你 2020-12-23 10:58

Xcode4 dropped PPC support, so when I try building PIL, it throws hate:

Bens-MacBook-Air:Imaging-1.1.7 bkeating$ python setup.py build
running buildrunning b         


        
相关标签:
4条回答
  • 2020-12-23 11:09

    The solution has nothing to do with PIL but rather setting gcc's ARCHFLAGS:

    ARCHFLAGS="-arch i386 -arch x86_64" sudo pip install PIL
    
    0 讨论(0)
  • 2020-12-23 11:27

    ARCHFLAGS doesn't seem to get passed into sudo. I had to do

    sudo -s
    

    then ARCHFLAGS="-arch i386 -arch x86_64" pip install PIL to make it work.

    0 讨论(0)
  • 2020-12-23 11:28

    A better way to solve this issue, in my opinion, would be to edit your ~/.profile or /etc/bashrc and add the line:

    export ARCHFLAGS="-arch i386 -arch x86_64"
    

    Will save messing around with any future installations (I've just had to do this for installing lots of Perl modules in CPAN)!

    0 讨论(0)
  • 2020-12-23 11:29

    Just to help others... I had to use ARCHFLAGS="-arch x86_64" before building imaging with my Snow Leopard/XCode 4 system i.e. having "-arch i386" in their stopped it working for me.

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