我是 Django 的新手,我不想用 SQLite 运行它,而是用我当前通过 PHP 设置的 MySQL 数据库来运行它。但是,我主要在 Mac 上编码(我的开发人员存在的祸根)并且我遇到了运行问题:
python setup.py build
从我的 MySQL-python-1.2.4b4 文件夹中,它给了我以下错误。我尝试用谷歌搜索解决方案,但大多数结果显示 XCode4 for Mac OS Lion 或 Mountain Lion 出现错误,我正在运行 Snow Leopard。我为 Snow Leopard 找到的结果也不起作用。
running develop
running egg_info
writing MySQL_python.egg-info/PKG-INFO
writing top-level names to MySQL_python.egg-info/top_level.txt
writing dependency_links to MySQL_python.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MySQL_python.egg-info/SOURCES.txt'
running build_ext
building '_mysql' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -pipe -Dversion_info=(1,2,4,'beta',4) -D__version__=1.2.4b4 -I/usr/local/mysql/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _mysql.c -o build/temp.macosx-10.6-universal-2.6/_mysql.o -g -Os -arch x86_64 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1