我正在尝试在运行mySQL的个人电脑ibook G4上安装Python的Python。我安装了Python 2.7.2,XCODE 3.1.3和MAMP 1.9.6。我尝试了MySQL-Python-1.2.2和MySQL-Python-1.2.3,但总是收到这个错误:
andreass-ibook-g4:MySQL-python-1.2.3 aed0101$ sudo python setup.py buildrunning build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.7/MySQLdb
running build_ext
building '_mysql' extension
gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -isysroot/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/Applications/MAMP/Library/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.3-fat-2.7/_mysql.o -fno-omit-frame-pointer -g
_mysql.c:36:23: error: my_config.h: No such file or directory
_mysql.c:38:19: error: mysql.h: No such file or directory
_mysql.c:39:26: error: mysqld_error.h: No such file or directory
...more errors
lipo: can't figure out the architecture type of: /var/tmp//ccM5WtnK.out
error: command 'gcc-4.0' failed with exit status 1有人能帮我吗?谢谢。
发布于 2012-11-09 07:26:08
看起来好像找不到MySQL开发头。如果从shell运行mysql_config出现错误,这可能就是原因。确保mysql_config在您的路径上,或者编辑site.cfg并在其中设置正确的路径。通常情况下,如果mysql_config出现错误退出,setup.py将会退出,因此不清楚这里发生了什么。
https://stackoverflow.com/questions/7131477
复制相似问题