pip 安装失败,/usr/bin/clang: 没有这样的文件或目录 [英] pip install fails with /usr/bin/clang: No such file or directory
问题描述
我正在将我的开发环境迁移到 10.8,但是我遇到了 pip 问题.
I am migrating my dev environment to 10.8, however I am having issues with pip.
具体来说,我使用的是 virtualenvs/virtualwrapper 但不能 pip install psycopg2
,并且在构建 psycopg2._psycopg
扩展的过程中,我得到:
Specifically, I'm using a virtualenvs/virtualwrapper but cannot pip install psycopg2
, and during the building of the psycopg2._psycopg
extension, I get:
unable to execute /usr/bin/clang: No such file or directory
error: command '/usr/bin/clang' failed with exit status 1
谁能提供解决方案?
推荐答案
这可能是因为您在升级后没有重新安装命令行工具.
This probably happens because you did not re-install the Command Line Tools after upgrading.
通常 XCode 应该升级到最新版本(4.4)(我相信当我更新到 10.8 时,我也更新了一大堆其他应用程序,包括 XCode).更新后您需要重新安装命令行工具.这现在可以通过 XCode 中的设置来完成:
Usually XCode should be upgraded to the latest version (4.4) (I believe when I updated to 10.8 I also updated a whole bunch of other applications, including XCode). After the update you need to re-install the Command Line Tools. This can now be done via a setting in XCode:
转到首选项 -> 下载"并安装命令行工具".
Go to "Preferences -> Downloads" and install "Command Line Tools".
现在安装需要编译的包应该没有问题了.
Now you should have no more problems when installing packages that need to be compiled.
这篇关于pip 安装失败,/usr/bin/clang: 没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!