2011-04-26 8 views
2

coverage 3.4을 현재 Mac OS X 10.6.7에서 실행되는 MacBook에 설치하려고했습니다. 이것이 내가 오류로 얻은 것입니다 :MacOSX에서 coverage.py를 컴파일하는 중 오류가 발생했습니다.

$ easy_install coverage 
install_dir /Users/jammon/workspace/myproject/lib/python2.7/site-packages/ 
Searching for coverage 
Reading http://pypi.python.org/simple/coverage/ 
Reading http://nedbatchelder.com/code/modules/coverage.html 
Reading http://nedbatchelder.com/code/coverage 
Reading http://nedbatchelder.com/code/coverage/3.4b1 
Reading http://nedbatchelder.com/code/coverage/3.4b2 
Best match: coverage 3.4 
Downloading http://pypi.python.org/packages/source/c/coverage/coverage-3.4.tar.gz#md5=46782809578c8fd29912c124d2420842 
Processing coverage-3.4.tar.gz 
Running coverage-3.4/setup.py -q bdist_egg --dist-dir /var/folders/10/10P5vwX-Ghmkg8s25PMr3E+++TI/-Tmp-/easy_install-UcskZB/coverage-3.4/egg-dist-tmp-QCs3YS 
no previously-included directories found matching 'test' 
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, 
       from coverage/tracer.c:3: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, 
       from coverage/tracer.c:3: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
lipo: can't figure out the architecture type of: /var/folders/10/10P5vwX-Ghmkg8s25PMr3E+++TI/-Tmp-//ccAYGjpc.out 
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1 

아무도 이해할 수 있습니까? 나는 무엇이 잘못되었는지를 이해하지 못한다. 또는 어떻게 해결할 수 있습니다.
도움을 주시면 감사하겠습니다.

업데이트 :
Ned의 의견을 듣고 나는 easy_install -vv coverage으로 시도했습니다. 결과는 크게 다르지 않다 :

... 
creating build/temp.macosx-10.3-fat-2.7/coverage 
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c coverage/tracer.c -o build/temp.macosx-10.3-fat-2.7/coverage/tracer.o 
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, 
       from coverage/tracer.c:3: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
In file included from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85, 
       from coverage/tracer.c:3: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
lipo: can't figure out the architecture type of: /var/folders/10/10P5vwX-Ghmkg8s25PMr3E+++TI/-Tmp-//ccZQsHOd.out 
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1 

는 지금까지 내가 기억하는, 나는 소스에서 표준 방법을 파이썬을 컴파일, 그것은 바이너리 배포판이 아니었다. 나는 virtualenv없이 그것을 시도했다.

+0

다소 이상합니다. 설치시 문제가 없어야합니다. 'easy_install -vv coverage '로 다시 실행하고'gcc' 명령 전체를보고하십시오. * 10.4u SDK에 문제가있을 수 있습니다. Xcode 3 설치 프로그램에서 다시 설치해보십시오. –

답변

6

XCode의 가장 최신 버전은 이전 PowerPC (PPC) 아키텍처로의 컴파일 지원을 제거합니다. 불행히도, Mac의 Python은 여전히 ​​x86뿐만 아니라 PPC 용 C 확장을 빌드하려고합니다. 당신이 use ActivePython이의 필요성을 미연에 방지 할 수있는 대안으로

ARCHFLAGS="-arch i386 -arch x86_64" easy_install coverage 
+0

그건 정말 해결책 같아요. 하지만 불행히도 나는 여전히 같은 오류가 발생합니다. 문제의 원인에 대한 조사를 위해 시간을 할애해야합니다. 어쨌든 고마워. – jammon

+1

당신은 여전히'gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot/개발자 /SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 - I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c coverage/tracer.c -o build/temp.macosx-10.3-fat-2.7/coverage/tracer.o ' -arch ppc' 중간에? 그것은 나쁜 부분입니다. – abdelazer

+0

이것은 Mac OS X 10.8 (Mountain Lion)에서 lxml (2.3.5)의 최신 버전을 컴파일하여 저에게 효과적이었습니다. – mgrandi

0

이 해결하기 위해, 접두사는 당신이 구축하고자하는 아키텍처를 포함하는 ARCHFLAGS 설정으로 'setup.py 설치'또는 'easy_install을'같은 명령 compile things yourself :

$ pypm install coverage 
The following packages will be installed into "~/Library/Python/2.7" (2.7): 
coverage-3.4 
Get: [pypm-free.activestate.com] coverage 3.4 
Installing coverage-3.4         
Fixing script ~/Library/Python/2.7/bin/coverage 
$ 
0

I 인터넷 검색을 많이 나를 위해 일한 this blogpost and the comments에서 해결책을 발견 한 후 : 나는 다음 같은을 보여 주었다있는 범위 (및 reportlab를 설치, /Developer/SDKs/MacOSX10.4u.sdk을 제거 문제)가 예상대로 작동했습니다.

stdarg.h의 처리가 gcc의 일부 버전에서 변경되어 설명 된 문제가 발생했습니다.

관련 문제