1

我正在尝试在运行 Leopard 的 PPC ibook G4 上安装 mySQL for 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

有人可以帮我吗?谢谢。

4

1 回答 1

1

似乎找不到 MySQL 开发标头。如果从 shell 运行 mysql_config 会出错,这可能就是原因。确保 mysql_config 在您的路径上,否则编辑 site.cfg 并在其中设置正确的路径。通常,如果 mysql_config 因错误退出,setup.py 将退出,因此不清楚这里发生了什么。

于 2012-11-08T23:26:08.400 回答