Mac osx lion, virtualenv, pil install - gcc error

后端 未结 5 927
刺人心
刺人心 2021-02-08 15:14

I have just completed the xcode install, mac osx lion. Upon completion I attempted to install PIL in a virtual enviroment using pip, easy_install and home brew. All three are er

5条回答
  •  [愿得一人]
    2021-02-08 15:16

    After spending hours on the same problem this is what it worked for me:

    Download the PIL source code and cd into it. Check which version of gcc do you have by:

    gcc
    i686-apple-darwin10-gcc-4.2.1: no input files
    

    Then I force to apply this version by:

    export CC=gcc-4.2
    

    And select the correct architecture (in my case 32bit):

    export ARCHFLAGS="-arch i386"
    

    For 64 use export ARCHFLAGS="-arch x86_64"

    Then build and install:

    python setup.py build
    python setup.py install
    

提交回复
热议问题