我目前正試圖建立和安裝的Python的MySQLdb的模塊,但命令錯誤當爲Python安裝MySQL-Python模塊2.7
python setup.py build
給我下面的錯誤
running build running build_py copying MySQLdb/release.py -> build/lib.macosx-10.3-intel-2.7/MySQLdb error: could not delete 'build/lib.macosx-10.3-intel-2.7/MySQLdb/release.py': Permission denied
我驗證了我是root用戶,當試圖用sudo執行腳本時,我得到一個gcc-4.0錯誤:
running 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 -g -O2 -DNDEBUG -g -O3 -Dversion_info=(1,2,3,'final',0) -D__version__=1.2.3 -I/usr/local/mysql/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 -Os -g -fno-common -fno-strict-aliasing -arch x86_64 unable to execute gcc-4.0: No such file or directory error: command 'gcc-4.0' failed with exit status 1
這很奇怪,因爲我在Python 2.7中使用XCode 4。我嘗試了easy_install和pip方法,這兩個方法都不起作用,並且在release.py上給我一個權限被拒絕的錯誤。我修改了這個文件,看看這是不是問題,但沒有運氣。思考?
它看起來像我沒有安裝gcc,您使用的操作系統是什麼? – Paulo