【发布时间】:2017-05-25 01:52:10
【问题描述】:
我希望能够从另一个安装的 Python 访问我的所有站点包,所以我以这种方式创建了一个虚拟环境:
venv my_project --system-site-packages
我注意到我的 Keras 版本已经过时了,所以我在我的 virtualenv 中执行了:
pip install keras
没有问题。我正在使用 pip 版本 9.0.1
我正在尝试运行一个使用 TensorFlow 的 python 程序,但是当我运行它时,我得到一个错误:
ImportError: No module named tensorboard.plugins
我搜索了一下,发现我需要升级 TensorFlow。我尝试了几个命令:
(my_project/) user@GPU5:~/spatial/zero_padded/powerlaw$ pip install tensorflow
上面给了我一个“要求已经满足”的错误。
$ pip install --target=~/spatial/zero_padded/powerlaw/my_project/ --upgrade tensorflow
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
which python的输出:
/user/spatial/zero_padded/powerlaw/my_project/bin/python
我认为我的PYTHONPATH 是第一行:
(my_project/) user@GPU5:~/spatial/zero_padded/powerlaw/my_project$ python -c "import sys; print '\n'.join(sys.path)"
/user/spatial/zero_padded/powerlaw/my_project
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python27.zip
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/plat-linux2
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/lib-tk
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/lib-old
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/lib-dynload
/user/spatial/zero_padded/powerlaw/my_project/lib/python2.7/site-packages
/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages
/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages/PIL
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/site-packages
如何在我的 virtualenv 中升级 TensorFlow?
【问题讨论】:
-
你能在你的 virtualenv 中发布
pip --freeze | grep -i tensorflow的输出吗?
标签: python tensorflow virtualenv