2016-06-20 143 views
3

安裝Tensorflow我試圖在Ubuntu 16.04安裝Tensorflow但在Ubuntu 16.04

Collecting tensorflow==0.7.1 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl 
    Using cached https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl 
Requirement already up-to-date: numpy>=1.8.2 in /usr/local/lib/python2.7/dist-packages (from tensorflow==0.7.1) 
Requirement already up-to-date: six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from tensCollecting tensorflow==0.7.1 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl 
    Using cached https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl 
Requirement already up-to-date: numpy>=1.8.2 in /usr/local/lib/python2.7/dist-packages (from tensorflow==0.7.1) 
Requirement already up-to-date: six>=1.10.0 in /usr/local/lib/python2.7/dist-packages (from tensorflow==0.7.1) 
Requirement already up-to-date: protobuf==3.0.0b2 in /usr/local/lib/python2.7/dist-packages (from tensorflow==0.7.1) 
Requirement already up-to-date: wheel in /usr/lib/python2.7/dist-packages (from tensorflow==0.7.1) 
Requirement already up-to-date: setuptools in /usr/local/lib/python2.7/dist-packages (from protobuf==3.0.0b2->tensorflow==0.7.1) 
Installing collected packages: tensorflow 
    Found existing installation: tensorflow 0.7.1 
    Uninstalling tensorflow-0.7.1: 
     Successfully uninstalled tensorflow-0.7.1 
Successfully installed tensorflow-0.7.1 
You are using pip version 8.1.1, however version 8.1.2 is available. 
You should consider upgrading via the 'pip install --upgrade pip' command. 
[email protected]:~$ python 
Python 2.7.11 |Continuum Analytics, Inc.| (default, Dec 6 2015, 18:08:32) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
Anaconda is brought to you by Continuum Analytics. 
Please check out: http://continuum.io/thanks and https://anaconda.org 
>>> import tensorflow 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
ImportError: No module named tensorflow 
orflow==0.7.1) 

我用sudo的-H,所以我不明白爲什麼會這樣。 我的Python安裝

readlink -f $(which python) | xargs -I % sh -c 'echo -n "%: "; % -V' 
/home/milenko/miniconda2/bin/python2.7: Python 2.7.11 :: Continuum Analytics, Inc. 
+0

您可能有多個Python安裝 - 默認的安裝和Anaconda版本,嘗試執行'/ usr/bin/python'或'/ usr/local/bin/python'而不是'python' –

+0

@ YaroslavBulatov是的,我安裝了nave miniconda。 –

+0

所以我猜想其中一個在'sys.path'中有'/ usr/local/lib/python2.7/dist-packages',另一個沒有,因此另一個沒有看到'tensorflow' –

回答

1

它爲我用this tutorial.

我用蟒蛇2.7版本,並創建了一個虛擬環境(隨意使用PY 3 &蟒蛇= 3.5):

conda create --name py2 python=2.7 anaconda 

不要忘記在安裝之前激活它(以後再使用!):

source activate py2 

我會建議升級scikit學習和libgcc中:

conda upgrade scikit-learn libgcc 

然後按照鏈接的教程。

自從5個月前問你以後,我認爲這已經發生了很大的變化,但我希望這會幫助人們絆倒這篇文章。在你的情況下,我想這確實是miniconda和系統python發行版之間的衝突。