我正在尝试在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因此,当我试图在虚拟环境中安装时,我希望在虚拟环境中而不是在/home/sasidhar/anaconda/lib/python2.7/site-packages中本地安装/home/sasidhar/anaconda/lib/python2.7/site-packages
发布于 2016-01-13 12:09:07
看来你已经安装好了。anaconda已经提供了一个环境管理系统(参见这里)。拥有两个系统(virtualenv和anaconda)似乎会扰乱您的python路径。
如果您希望使用conda环境,则不需要安装virtualenv。只需为tensorflow安装创建一个新的conda即可。
如果您的安装仍然有问题,您可以看看我的答案这里。这是针对Mac的,但是所描述的步骤应该适用于任何系统。
https://stackoverflow.com/questions/33643196
复制相似问题