【问题标题】:Can't pip install anything requiring C compilation on OSX 10.10 with homebrew python无法使用 homebrew python 在 OSX 10.10 上安装任何需要 C 编译的东西
【发布时间】:2014-10-14 16:15:12
【问题描述】:

当我尝试 pip install 涉及 C 编译的事情(特别是 Pillow)时,我收到一个奇怪的错误:

clang: error: no such file or directory: 'Python.framework/Versions/2.7/Python'

error: command 'clang' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/local/opt/python/bin/python2.7 -c "import setuptools, tokenize;__file__='/private/var/folders/xt/f2d8vp4j65j2rt71pns6trjw0000gn/T/pip_build_jakob/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/xt/f2d8vp4j65j2rt71pns6trjw0000gn/T/pip-LnL0hW-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/xt/f2d8vp4j65j2rt71pns6trjw0000gn/T/pip_build_jakob/Pillow

I posted my pip.log for this installation.

我认为这个问题是由于 OSX 10.10 Yosemite 和 Homebrew python 的结合造成的。你以前有过这种经历吗?关于如何解决它的想法?

【问题讨论】:

  • 你使用的是什么版本的 Homebrew Python?
  • 最新的python 2.
  • 你试过升级到 Python 3 吗?显然,使用 Python 2.7 会引发此错误,但不会。在这里看到:github.com/pypa/pip/issues/1861
  • 这是我的错误报告 :) - 如何切换到 python 3?我已经安装了它,但是如何让 pip 使用它呢?
  • 啊,抓住了我! blog.manbolo.com/2013/02/04/…

标签: python macos pip osx-yosemite


【解决方案1】:

您需要安装 XCode 才能在 OS X 上编译。

【讨论】:

    猜你喜欢
    • 2014-12-10
    • 1970-01-01
    • 2018-09-20
    • 2019-02-28
    • 2012-09-06
    • 2021-05-02
    • 2014-06-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多