2014-05-09 1 views
6

이 시점에서 수많은 솔루션을 시도했지만 아무 것도 작동하지 않습니다. 나는 mysql을 - 파이썬을 설치하려고 해요,하지만이 NumPy와 함께 발생하고 다른 패키지뿐만 아니라 GCC를 요구 :pip는 Mac OS X에서 stdio.h 오류를 발견하지 못합니다. Mavericks (10.9)

building '_mysql' extension 

gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64 

In file included from _mysql.c:29: 

/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:33:10: fatal error: 'stdio.h' file not found 

#include <stdio.h> 

     ^

1 error generated. 

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

이 점에 :

내가 명령 줄 도구

추가 심볼릭 링크에서 설치 한 괜찮 자체 GCC 그래서는/usr/빈/GCC는,

gcc-4.2 --version 
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) 
Target: x86_64-apple-darwin13.1.0 
Thread model: posix 

가 성공적으로 컴파일 된 더미 C 파일을 만든 /usr/bin/gcc-4.2, 그것을 실행하는

그리고 좋은 측정을위한

$ cat a.c 
#include <stdio.h> 

main() 
{ 
    printf("hello\n"); 
} 

$ gcc-4.2 a.c 
a.c:3:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] 
main() 
^~~~ 
1 warning generated. 

$ ./a.out 
hello 
, 무슨 일

$ xcode-select -p 
/Library/Developer/CommandLineTools 

!

편집은 - 신나는 개발 - 파이썬 버전

$ python 
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 

편집을 포함하도록 잊어 버렸습니다. 그것은 내가 명령 도구를 할 필요 유사한 오류 용의자

gcc-4.2 -bundle -undefined dynamic_lookup -isysroot /Developer/SDKs/MacOSX10.6.sdk -isysroot /Developer/SDKs/MacOSX10.6.sdk -g -Wall -undefined dynamic_lookup -bundle build/temp.macosx-10.6-intel-2.7/_mysql.o -L/usr/local/mysql/lib -lmysqlclient_r -o build/lib.macosx-10.6-intel-2.7/_mysql.so -arch x86_64 

ld: library not found for -lSystem 

clang: error: linker command failed with exit code 1 (use -v to see invocation) 

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

에 다시 실패 그러나

$ export CFLAGS="-arch i386 -arch x86_64" 
$ export FFLAGS="-m32 -m64" 
$ export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" 
$ export CC=gcc-4.2 
$ export CXX="g++ -arch i386 -arch x86_64" 

:이 변수를 설정하면 일부 진전을합니다. 또한 "/Developer/SDKs/MacOSX10.6.sdk"를 사용하는 이유는 무엇입니까? @wegry가 확인 above--

brew install python 

을 언급 한 바와 같이

+0

2.7.2를 사용하는 이유가 있습니까? 나는 10.9가 2.7.4와 함께 선적되었다고 생각했다. 파이썬을 설치 했나요? – wegry

+1

Snow Leopard에서 업그레이드했는데, 매버릭스는 실제로 파이썬을 업그레이드하지 않았을까? 수동으로 설치하지 않았습니다. – beans

+2

양조를 설치하려고합니다. 그리고 파이썬을 설치합니다. 그것은 pip를 설치합니다. 또한 명령 줄 도구가 오래되어 도움이되는지 알려줄 것입니다. 다행히도 OS X에서 덜 불안한 것들을 만들 수 있기를 바랍니다. – wegry

답변

3

(:(내가/맥 pycharm 정력/유닉스 마이그레이션하기 위해 노력하고있어, 멍청한 놈 질문을 용서하고 지금까지 아주 잘 않을거야)

$ which python 
/usr/local/homebrew/bin/python 

그냥이 완전히 사라했다. 성공적으로 주사위와 NumPy와와 mysql을 - 파이썬을 설치!

2

이 나를

을 위해 일
xcode-select --install