tensorflow正在anaconda / lib / python2.7 / site-packages中安装

时间:2015-11-11 02:18:39

标签: virtualenv tensorflow

我试图在tensorflow

中安装virtualenv

安装后,我收到了已安装tensorflow的消息 /home/username/anaconda/lib/python2.7/site-packages

如何在虚拟环境的网站包中安装它?

修改

我使用的是ubuntu 14.04.2 LTS
以下是我执行的指令序列

sudo apt-get install python-pip python-dev python-virtualenv

virtualenv --system-site-packages ~/tensorflow

cd ~/tensorflow

source bin/activate

我遇到了tensorflow-0.5.0-py2-none-any.whl is not a supported wheel on this platform.

尝试执行时

pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

所以我必须按照https://askubuntu.com/questions/695981/platform-not-supported-for-tensorflow-on-ubuntu-14-04-2

的说明进行操作

执行后

python2.7 -m pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl

我得到了输出

Requirement already up-to-date: six>=1.10.0 in /home/sasidhar/anaconda/lib/python2.7/site-packages (from tensorflow==0.5.0)
Requirement already up-to-date: numpy>=1.9.2 in /home/sasidhar/anaconda/lib/python2.7/site-packages (from tensorflow==0.5.0)
Installing collected packages: tensorflow
Installing collected packages: tensorflow
Found existing installation: tensorflow 0.5.0
Uninstalling tensorflow-0.5.0:
  Successfully uninstalled tensorflow-0.5.0
Successfully installed tensorflow-0.5.0

因此我尝试在虚拟环境中安装时,我想在虚拟环境中本地安装tensorflow而不是/home/sasidhar/anaconda/lib/python2.7/site-packages

1 个答案:

答案 0 :(得分:0)

看来你已经安装了anaconda。 anaconda已经配备了一个环境管理系统(见here)。有两个系统(virtualenv和anaconda)似乎搞乱了你的python路径。

如果您想使用conda环境,那么您不需要安装virtualenv。只需为tensorflow安装创建一个新的conda env。

如果您仍然遇到安装问题,可以查看我的回答here。它适用于Mac OS X,但所描述的步骤适用于任何系统。