在Mac OS X 10.9.2上的mysql-python:错误:命令'/usr/bin/clang'失败,退出状态为1 [英] mysql-python on mac osx 10.9.2: error: command '/usr/bin/clang' failed with exit status 1
问题描述
我想将django应用程序从sqlite移植到mysql.
I wanted to port my django app from sqlite to mysql.
但是当我尝试安装mysql-python时,它给了我这个错误: 错误:命令'/usr/bin/clang'失败,退出状态为1
But when I'm trying to install mysql-python, it gives me this error: error: command '/usr/bin/clang' failed with exit status 1
我环顾四周寻找线索,并尝试了这种解决方案,该解决方案似乎对大多数人都有效:
I looked around for clues and tried this solution which seemed to have worked for most people:
苏多苏 导出CFLAGS =-带参数 export CPPFLAGS =-带参数 pip安装MySQL-python
sudo su export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments pip install MySQL-python
完整的错误日志在这里:
The complete error log is here:
pip install MySQL-python
Downloading/unpacking MySQL-python
Running setup.py egg_info for package MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
building '_mysql' extension
/usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/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
xcrun: error: active developer path ("/Users/deeptichopra/Desktop/Applications and Softwares/Xcode.app/Contents/Developer") does not exist, use xcode-select to change
error: command '/usr/bin/clang' failed with exit status 1
Complete output from command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y71a30-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_py
copying MySQLdb/release.py -> build/lib.macosx-10.6-intel-2.7/MySQLdb
running build_ext
building '_mysql' extension
/usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/mysql/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
xcrun: error: active developer path ("/Users/deeptichopra/Desktop/Applications and Softwares/Xcode.app/Contents/Developer") does not exist, use xcode-select to change
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
Command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build/MySQL-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-y71a30-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build/MySQL-python
Storing complete log in /var/root/.pip/pip.log
这是/var/root/.pip/pip.log:
Here is /var/root/.pip/pip.log:
Downloading/unpacking MySQL-python
Running setup.py egg_info for package MySQL-python
running egg_info
writing pip-egg-info/MySQL_python.egg-info/PKG-INFO
writing top-level names to pip-egg-info/MySQL_python.egg-info/top_level.txt
writing dependency_links to pip-egg-info/MySQL_python.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found
reading manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pip-egg-info/MySQL_python.egg-info/SOURCES.txt'
Source in /tmp/pip-build/MySQL-python has version 1.2.5, which satisfies requirement MySQL-python
Installing collected packages: MySQL-python
Running setup.py install for MySQL-python
Running command /Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools;__file__='/tmp/pip-build//var/root/.pip/pip.log
推荐答案
我知道这个问题有点晚了,但是对于后来出现的问题,我相信这是因为您没有xcode或xcode工具已安装.获得xcode后,您可以使用以下方法安装xcode工具:
I know this is a little late to the question, but for those that come along later, I believe this is because you don't have xcode or xcode tools installed. Once you have xcode, you can install xcode tools with:
xcode-select --install
这篇关于在Mac OS X 10.9.2上的mysql-python:错误:命令'/usr/bin/clang'失败,退出状态为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!