简体   繁体   English

在Anaconda上安装tensorflow

[英]Installing tensorflow on Anaconda

I have a linux machine to which i installed Anaconda. 我有一台安装了Anaconda的linux机器。 I am following: 我跟随:

https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html https://www.tensorflow.org/versions/r0.10/get_started/os_setup.html

pip instaltion part. 点子安装部分。

To be more specific: 更加具体:

which python

gives

/home/user/anaconda2/bin/python  

After which i entered: 之后我进入:

export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0-cp27-none-linux_x86_64.whl

And after: 之后:

sudo pip install --upgrade $TF_BINARY_URL

However, while trying: 但是,在尝试时:

python -c "import tensorflow"

I get an import error: 我收到导入错误:

ImportError: No module named tensorflow

The 'sudo' makes pip install tensorflow outside the env. 'sudo'使得pv install tensorflow在env之外。 Try: 尝试:

pip install --upgrade $TF_BINARY_URL pip install --upgrade $ TF_BINARY_URL

Just tested this on Ubuntu 14.04 w/ conda env, was able to reproduce (with sudo) and resolve issue (without sudo). 刚刚在Ubuntu 14.04 w / conda env上测试了这个,能够重现(使用sudo)并解决问题(没有sudo)。

You can also check the "Using Conda" section of tensorflow.org . 您还可以查看tensorflow.org的“使用Conda”部分。 They list the below: 他们列出如下:

# Python 2
(tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL

# Python 3
(tensorflow)$ pip3 install --ignore-installed --upgrade $TF_BINARY_URL

In anaconda, simply do: 在anaconda中,只需:

for installation 用于安装

conda install -c conda-forge tensorflow

for update/upgrade 用于更新/升级

# -f will force the current installation to upgrade
conda update -f -c conda-forge tensorflow

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM