我为什么会收到错误消息:命令"llvm-gcc-4.2"失败,退出状态为1 [英] Why am I getting the error: command 'llvm-gcc-4.2' failed with exit status 1

查看:78
本文介绍了我为什么会收到错误消息:命令"llvm-gcc-4.2"失败,退出状态为1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置os X 10.7.

I am setting up os X 10.7.

我正在使用Python的默认安装:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/

I am using the default install of Python:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/

我使用了一个基于Python的软件包管理器,名为easy_install. Easy_install似乎无法找到编译器.

I use a Python based package manager called easy_install. Easy_install seems to not be able to find the compiler.

当我尝试安装MySQL-python时,出现此错误:

When I tried to install MySQL-python I got this error:

$ sudo easy_install MySQL-python 
Password:
Searching for MySQL-python
Reading http://pypi.python.org/simple/MySQL-python/
Reading http://sourceforge.net/projects/mysql-python/
Reading http://sourceforge.net/projects/mysql-python
Best match: MySQL-python 1.2.3
Downloading http://download.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.3.tar.gz
Processing MySQL-python-1.2.3.tar.gz
Running MySQL-python-1.2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-P9H9WX/MySQL-python-1.2.3/egg-dist-tmp-rRTfZL
warning: no files found matching 'MANIFEST'
warning: no files found matching 'ChangeLog'
warning: no files found matching 'GPL'
unable to execute llvm-gcc-4.2: No such file or directory
error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1

错误:安装脚本退出,并显示错误:命令"llvm-gcc-4.2"失败,退出状态为1

error: Setup script exited with error: command 'llvm-gcc-4.2' failed with exit status 1

Xcode 4.1使用了GCC,但Xcode 4.2似乎已更改.

Xcode 4.1 used GCC, but with Xcode 4.2 that seems to have changed.

Apple希望我们使用什么编译器? 如何设置配置以便可以编译OSS?

What compiler does Apple want us to use? How do I setup the configuration so I can compile OSS?

推荐答案

从OSX 10.6升级到10.7时,我遇到了完全相同的问题.如果您从10.6升级到10.7,则您的Python版本可能会从2.6升级到2.7,结果您可能需要重新安装大多数python软件包.

I had the exact same problem when I upgraded from OSX 10.6 to 10.7. If you upgrade to 10.7 from 10.6, your version of Python may go from 2.6 to 2.7 and a result you may need to re-install most of your python packages.

这对我有用:

  1. 从App Store安装最新版本的XCode
  2. 在XCode内,转到首选项"->下载"->组件"
  3. 下载命令行工具

这就是您需要做的.尝试再次安装在新的外壳中.命令行工具安装会将llvm-gcc-4.2放入/usr/bin中,该目录应位于您的默认路径中.安装过程还将照顾您真正不想知道的库路径和内容,除非出现问题.

That's all you need to do. Try to install again in a new shell. The command line tool installation will put llvm-gcc-4.2 into /usr/bin which should be in your default path. The installation also takes care of library paths and stuff that you don't really want to know about unless something breaks.

10.9修改

如果您运行的是10.9或更高版本,我想您也许可以从命令行运行此命令,而不是安装命令行工具:

If you're running 10.9 or higher, I think you might be able to run this from the command line instead to install the command line tools:

xcode-select --install

我尚未验证这是否是解决该问题的实际方法.

I haven't verified that this is an actual fix to the problem.

这篇关于我为什么会收到错误消息:命令"llvm-gcc-4.2"失败,退出状态为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆