1

ここからtarファイルをダウンロード

http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/

http://decoding.wordpress.com/2012/01/23/how-to-setup-django-and-mysql-python-on-mac-os-x-lion/のガイドに従いました。

Djangoが正常にインストールされました。mysql_config=/usr/local/mysql-5.6.10-osx10.7-x86_64/mysql_configのsite.cfg構成を変更しました

次に、sudo pythonsetup.pybuildを実行しました

この出力を取得しました

dyld: DYLD_ environment variables being ignored because main executable (/usr/bin/sudo)    is setuid or setgid
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-2.7
copying _mysql_exceptions.py -> build/lib.macosx-10.6-intel-2.7
creating build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/__init__.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/converters.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/connections.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/cursors.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
copying MySQLdb/times.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
creating build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/__init__.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CR.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/ER.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/FLAG.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/REFRESH.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
copying MySQLdb/constants/CLIENT.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb/constants
running build_ext
building '_mysql' extension
creating build/temp.macosx-10.6-intel-2.7
gcc-4.2 -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-5.6.10-osx10.7-x86_64/include -    I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o     build/temp.macosx-10.6-intel-2.7/_mysql.o -Os -g -fno-strict-aliasing -arch x86_64
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1

これらのエラーはどこから来ていますか?ユキヒョウの解決策は見つかりましたが、マウンテンライオンの解決策は見つかりませんでした。ありがとう。

4

1 に答える 1

2

gcc-4.2インストールしていないようです。呼び方が違うので注意。私のマシンでは、gcc 実行可能ファイルが呼び出されますgcc-apple-4.2

于 2013-02-22T14:00:32.570 に答える