2011-08-20 58 views
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,但我总是收到此错误:python mySQL PPC Mac安装

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 

任何人可以帮助我吗? 谢谢。

+2

您是否尝试过使用macport进行安装,比自行构建每个软件包要简单得多。此外,由于使用移植的BSD软件包,因此您的开发环境将与您的生产环境同步.http://www.macports.org/ –

回答

1

它看起来像没有找到MySQL开发头文件。如果从shell运行mysql_config会出现错误,那可能是为什么。确保你的路径上有mysql_config,否则编辑site.cfg并在那里设置正确的路径。如果mysql_config退出时出现错误,通常setup.py将会退出,所以不清楚这里发生了什么。