【问题标题】:How to pip install tensorflow on El Capitan?如何在 El Capitan 上安装 tensorflow?
【发布时间】:2016-06-14 11:05:21
【问题描述】:

似乎 El Capitan 的系统完整性保护使我无法按照说明在 OSX 上运行 Tensorflow。

我关注了the installation guide,但最后的安装步骤失败了:

sudo pip install --upgrade $TF_BINARY_URL

失败:

Uninstalling numpy-1.8.0rc1:
...
OSError: [Errno 1] Operation not permitted

我已经设法通过忽略安装六个:

sudo pip install --upgrade $TF_BINARY_URL --ignore-installed six

但是现在测试我的安装不起作用:

$ python
Python 2.7.10 (default, Oct 23 2015, 19:19:21) 
[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
....
ImportError: numpy.core.multiarray failed to import

【问题讨论】:

    标签: python tensorflow osx-elcapitan


    【解决方案1】:

    我设法通过使用 easy_install 升级 numpy.这看起来很糟糕,所以我很想听听更好的解决方案,或者让有人向我解释为什么这很好。

    命令,对于那些一起玩的人:

    sudo easy_install numpy
    

    【讨论】:

    • 我在使用 numpy 和 CV2 时遇到了同样的问题。该错误表明需要版本 10 (0xa),所以我尝试 pip install "numpy==1.10.1" 没有运气。最后,easy_install 成功了!很高兴知道为什么。
    • 使用sudo easy_install --upgrade numpy 指定升级对我有用。
    猜你喜欢
    • 2019-01-21
    • 2016-06-18
    • 2016-01-20
    • 1970-01-01
    • 1970-01-01
    • 2016-03-11
    • 2018-06-19
    • 1970-01-01
    • 2016-11-27
    相关资源
    最近更新 更多