2012-09-18 2 views
0

virtualenv에서 pip를 사용하여 OSX 10.6.8에 PIL을 설치하려고하지만 gcc가 1 종료 상태를 반환하면 실패합니다.pip install OSX에서 PIL이 실패 함

$ pip install PIL 
Downloading/unpacking PIL 
    Running setup.py egg_info for package PIL 
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py 
Installing collected packages: PIL 
    Running setup.py install for PIL 
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py 
    --- using frameworks at /System/Library/Frameworks 
    building '_imaging' extension 
    gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/DataGreed/workspaces/vitrualenv/project/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o 
    _imaging.c:3017: warning: initialization from incompatible pointer type 
    _imaging.c:3077: warning: initialization from incompatible pointer type 
    /usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/as/ppc/as or /usr/bin/../local/libexec/as/ppc/as) for architecture ppc not installed 
    Installed assemblers are: 
    /usr/bin/../libexec/as/x86_64/as for architecture x86_64 
    /usr/bin/../libexec/as/i386/as for architecture i386 
    /usr/bin/../libexec/as/arm/as for architecture arm 
    _imaging.c:3017: warning: initialization from incompatible pointer type 
    _imaging.c:3077: warning: initialization from incompatible pointer type 
    _imaging.c:3281: fatal error: error writing to -: Broken pipe 
    compilation terminated. 
    _imaging.c:3017: warning: initialization from incompatible pointer type 
    _imaging.c:3077: warning: initialization from incompatible pointer type 
    lipo: can't open input file: /var/folders/sO/sODPLYP7Goy5NCFskrL1dE+++TM/-Tmp-//ccds0vgZ.out (No such file or directory) 
    error: command 'gcc-4.2' failed with exit status 1 
    Complete output from command /Users/DataGreed/workspaces/vitrualenv/project/bin/python -c "import setuptools;__file__='/Users/DataGreed/workspaces/vitrualenv/project/build/PIL/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/sO/sODPLYP7Goy5NCFskrL1dE+++TM/-Tmp-/pip-BNAuaC-record/install-record.txt --single-version-externally-managed --install-headers /Users/DataGreed/workspaces/vitrualenv/project/bin/../include/site/python2.6: 
    WARNING: '' not a valid package name; please use only.-separated package names in setup.py 

running install 

running build 

running build_py 

running build_ext 

--- using frameworks at /System/Library/Frameworks 

building '_imaging' extension 

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/DataGreed/workspaces/vitrualenv/project/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o 

_imaging.c:3017: warning: initialization from incompatible pointer type 

_imaging.c:3077: warning: initialization from incompatible pointer type 

/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/as/ppc/as or /usr/bin/../local/libexec/as/ppc/as) for architecture ppc not installed 

Installed assemblers are: 

/usr/bin/../libexec/as/x86_64/as for architecture x86_64 

/usr/bin/../libexec/as/i386/as for architecture i386 

/usr/bin/../libexec/as/arm/as for architecture arm 

_imaging.c:3017: warning: initialization from incompatible pointer type 

_imaging.c:3077: warning: initialization from incompatible pointer type 

_imaging.c:3281: fatal error: error writing to -: Broken pipe 

compilation terminated. 

_imaging.c:3017: warning: initialization from incompatible pointer type 

_imaging.c:3077: warning: initialization from incompatible pointer type 

lipo: can't open input file: /var/folders/sO/sODPLYP7Goy5NCFskrL1dE+++TM/-Tmp-//ccds0vgZ.out (No such file or directory) 

error: command 'gcc-4.2' failed with exit status 1 

UPD : 같은 OSX 버전과 다른 컴퓨터에 그것을 완벽하게 설치 : 여기

내가 무엇을 얻을 -/

UPD2 : 실제로 더 이상한 것은이 . PIL은 이미 virtualenv 외부 pip에 설치되어 있습니다. 하지만 난 virtualenv에서만 설치할 수 없습니다.

UPD3 :가 도울 수 있다면 난 몰라,하지만 난 래퍼 스크립트를 VIRTUALENV로드 할 때, 난이 있어요 : 나는 workon를 사용하는 경우

/Library/Python/2.6/site-packages/stevedore/extension.py:4: UserWarning: Module 

pkg_resources was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.pyc, but /Library/Python/2.6/site-packages is being added to sys.path 
    import pkg_resources 
/Library/Python/2.6/site-packages/stevedore/extension.py:4: UserWarning: Module site was already imported from /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site.pyc, but /Library/Python/2.6/site-packages is being added to sys.path 
    import pkg_resources 

, 내가 같은 경고를 얻을.

답변

1

시도해 보셨습니까 베개? (pip install pillow는) :

http://pypi.python.org/pypi/Pillow/

그것은 훨씬 쉽게 PIL 삶을합니다. 필자는 virtualenv와 virtualenvwrapper를 사용하여 PIL을 OSX에 설치할 수있었습니다.

+0

안녕하세요, 나는 그것을 시도했지만 불행하게도, 난 핍 정확하게 무엇을 설치 않는 문제가있는 시스템에서 동일한 오류 :( – DataGreed

+0

을 얻을? –

+0

그래, 내가 노력 다른 모든 등, 장고, 제대로 – DataGreed

0

광산은 당신이 4.2로 구축되는 동안

광산, GCC-4.0 건설되고있다 ... 10.6.8에 VIRTUALENV에 잘 설치하지만, 4.2가 기본값이어야합니다.

그래서 실제로 gcc-4.0으로 빌드 된 이유를 모르지만 제대로 작동합니다.

$ which gcc 
/usr/bin/gcc 
$ ls -alh /usr/bin/gcc 
lrwxr-xr-x 1 root wheel  7B Jan 3 2012 /usr/bin/gcc -> gcc-4.2 
+0

글쎄, 아마도 p로 symlink를 바꿀 수 있습니다 gcc-4.0으로 바꾼다. 그러나 그것은 꽤 못생긴 해결 방법이다 (비록 작동한다고하더라도). – DataGreed

+0

위의 그림과 같이 gcc symlink가 4.2를 가리킨다. 어떤 이유로 든 내 컴퓨터에는 Python이 읽고 읽고 쓰는 대신 4.0을 사용하기로 결정합니다. (이미 env 변수 확인) –

+0

virtualenv가 다른 버전의 Python을 사용하고있을 가능성이 있습니까? 아마도 문제가있는 시스템은 설치가 깨끗하지 않기 때문에 다른 시스템의 구성 정보로 하나의 Python을 실행하려고 시도하고있을 것입니다. 또한 파이썬의 일반적인 gcc 문제에 대해 다음 토론을 살펴보십시오. http://stackoverflow.com/questions/5944228/python-build-using-wrong-version-of-gcc-on-os-x http : //stackoverflow.com/questions/5967065/python-distutils-not-using-correct-version-of-gcc –