简体   繁体   English

mac osx 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

I wanted to port my django app from sqlite to mysql. 我想将我的django应用程序从sqlite移植到mysql。

But when I'm trying to install mysql-python, it gives me this error: error: command '/usr/bin/clang' failed with exit status 1 但是当我尝试安装mysql-python时,它给了我这个错误:错误:命令'/ usr / bin / clang'失败,退出状态为1

I looked around for clues and tried this solution which seemed to have worked for most people: 我四处寻找线索并尝试了这个似乎适用于大多数人的解决方案:

sudo su export CFLAGS=-Qunused-arguments export CPPFLAGS=-Qunused-arguments pip install 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

Here is /var/root/.pip/pip.log: 这是/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 

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. 我知道这个问题有点晚了,但是对于那些后来出现的人,我相信这是因为你没有安装xcode或xcode工具。 Once you have xcode, you can install xcode tools with: 拥有xcode后,您可以使用以下命令安装xcode工具:

xcode-select --install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 OSX - #include "portaudio.h" 生成 1 个错误。 错误:命令“/usr/bin/clang”失败,退出状态为 1 - OSX - #include "portaudio.h" 1 error generated. error: command '/usr/bin/clang' failed with exit status 1 在 Mac OS 10.13.15 上安装 MySQL-python 导致命令“clang”失败,退出状态为 1 - Installing MySQL-python causes command 'clang' failed with exit status 1 on Mac OS 10.13.15 Mac OS 中的 Pip 安装错误(错误:命令“/usr/bin/clang”失败,退出状态为 1) - Pip install error in Mac OS(error: command '/usr/bin/clang' failed with exit status 1) 错误:命令“cc”在 Mac 上失败,退出状态为 1,用于 pip install MySQL-python - error: command 'cc' failed with exit status 1 on Mac for pip install MySQL-python 命令“ / usr / bin / clang ++ -bundle -undefined…”失败,退出状态为1 - Command “/usr/bin/clang++ -bundle -undefined…” failed with exit status 1 mysql-python无法在OSX 10.9.2上安装 - mysql-python fails to install on OSX 10.9.2 MySQL-python,错误:命令'gcc-4.2'失败,退出状态为1 - MySQL-python, error: command 'gcc-4.2' failed with exit status 1 pip安装MySQL-python在ubuntu 14.04上失败,错误:命令'x86_64-linux-gnu-gcc'失败,退出状态为1 - pip install MySQL-python fails on ubuntu 14.04, error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 python2.7在virtualenv中安装MySQL-python错误“退出状态2失败” - python2.7 install MySQL-python in virtualenv error “failed with exit status 2” 无法安装python模块:命令'/ usr / bin / llvm-gcc'失败,退出状态为1 - Cannot install python module: command '/usr/bin/llvm-gcc' failed with exit status 1
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM