2016-06-14 101 views
5

El Capitan的系統完整性保護似乎阻止我遵循在OSX上運行Tensorflow的說明。如何在El Capitan上安裝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 

回答

4

我設法通過使用easy_install升級numpy來使它工作。這似乎是一個討厭的混亂,所以我很想聽到更好的解決方案,或有人向我解釋爲什麼這很好。

的命令,對於那些一起演奏:

sudo easy_install numpy 
+1

我不得不使用numpy的與CV2相同的問題。錯誤建議版本10(0xa)是必需的,所以我嘗試了pip安裝「numpy == 1.10.1」,但沒有運氣。最後,easy_install工作!很高興知道爲什麼。 – oortCloud

+0

用'sudo easy_install --upgrade numpy'指定升級爲我工作。 – Serenthia