2010-06-12 49 views
2

我想爲python安裝MySQLdb。 但是當我運行安裝程序時,這是我得到的錯誤。Python的Django MySQLdb的安裝問題:: setup.py不能建立由於不正確的位置mysql

好吧,我知道爲什麼它給所有缺少的文件語句,但不知道從哪裏改變大膽的標記位置。

請幫

gaurav-toshniwals-macbook-7:MySQL-python-1.2.3c1 gauravtoshniwal$ python setup.py build 
running build 
running build_py 
copying MySQLdb/release.py -> build/lib.macosx-10.3-fat-2.6/MySQLdb 
running build_ext 
building '_mysql' extension 
gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'gamma',1) -D__version__=1.2.3c1 **-I/Applications/MAMP/Library/include/mysql** -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.3-fat-2.6/_mysql.o 
_mysql.c:36:23: error: my_config.h: No such file or directory 
_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:38:19:_mysql.c:39:26: error: mysqld_error.h: No such file or directory 
error: _mysql.c:40:20:mysql.h: No such file or directory 

回答

0

此路徑可能來自mysql_config工具,編輯您setup_posix.py和改變變量mysql_config.path,以滿足您的正確mysql_config公用工程路徑。

0

上述建議非常有幫助,但也可能值得一提的是,您必須安裝mysql-devel,以便您的構建在此處取得成功。