Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在虚拟环境python 2.7中安装Tensorflow_Python_Tensorflow_Pip_Virtualenv_Six - Fatal编程技术网

在虚拟环境python 2.7中安装Tensorflow

在虚拟环境python 2.7中安装Tensorflow,python,tensorflow,pip,virtualenv,six,Python,Tensorflow,Pip,Virtualenv,Six,请问,如何在虚拟环境中安装Tensorflow?我使用过这些命令,但不起作用 sudo -H pip3 install tensorflow --proxy https://XXX.XX.XX.X:3128 sudo -E pip3 install tensorflow --proxy https://XXX.XX.XX.X:3128 sudo -E pip install tensorflow --proxy https://XXX.XX.XX.X:3128 sudo -H pip

请问,如何在虚拟环境中安装Tensorflow?我使用过这些命令,但不起作用

sudo -H pip3 install tensorflow  --proxy https://XXX.XX.XX.X:3128

sudo -E pip3 install tensorflow  --proxy https://XXX.XX.XX.X:3128

sudo -E pip install tensorflow  --proxy https://XXX.XX.XX.X:3128

sudo -H pip install tensorflow  --proxy https://XXX.XX.XX.X:3128

sudo  pip install tensorflow  --proxy https://XXX.XX.XX.X:3128
结果是:

Downloading/unpacking tensorflow
Cannot fetch index base URL https://pypi.python.org/simple/
以下是我的python和pip版本:

(venv)root@graphene-62:~/tensorflow# pip -V
pip 8.1.2 from /usr/local/lib/python2.7/dist-packages/pip-8.1.2-py2.7.egg
(python 2.7)
(venv)root@graphene-62:~/tensorflow# python -V
Python 2.7.6
在我尝试了
pip安装-U tensorflow
之后,我得到了以下结果:

Cannot uninstall 'six'
然后我尝试了
pip安装-U tensorflow--ignore installed six
,通过tf版本检查,我得到:

(venv)root@graphene-62:~/tensorflow# python -c "import tensorflow as tf; print(tf.__version__)" 
Illegal instruction (core dumped) (venv)root@graphene-62:~/tensorflow#

是否有其他方法下载和安装Tensorflow?

请确保您的pip版本是最新的:

pip install -U pip
然后,根据评论和编辑的问题,执行:

pip install -U tensorflow==1.5.0 --ignore-installed six
python -c "import tensorflow as tf; print(tf.__version__)"
这将忽略
six
相关错误,轻微降级的tensorflow软件包将在没有非法指令错误的情况下安装和使用

要检查安装是否成功,请执行:

pip install -U tensorflow==1.5.0 --ignore-installed six
python -c "import tensorflow as tf; print(tf.__version__)"

最近,使用python 2.7的pip安装tensorflow可能会导致错误消息:

找不到满足tensorflow要求的版本(来自版本:) 找不到tensorflow的匹配分布

您可以通过以下方式安装TensorFlow:

pip install -U https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.14.0-cp27-none-linux_x86_64.whl
您可以将控制盘的URL替换为来自的其他URL


tensorflow gpu

相同的问题,您希望在哪个python版本上使用tensorflow?您使用的是来自/usr/local/lib/python2.7/dist-packages/pip-8.1.2(python 2.7)的(venv-->pip-V pip 8.1.2中的3.*和2.*版本..的命令@marcuse@marcuse任何最新版本的Tensorflow@marcusepyhton-V-->2.7.6第一个命令工作正常。使用我的第二个命令:无法卸载“six”。这是一个distutils安装的项目,因此我们无法准确确定哪些文件属于它,这将导致仅部分卸载。>>>导入tensorflow作为tf回溯(最后一次调用):文件“”,第1行,在ImportError中:没有名为tensorflowTry的模块
pip安装-U tensorflow--忽略(venv)中安装的六个(venv)root@graphene-62:~/tensorflow#python-c“将tensorflow作为tf导入;打印(tf.u版本)uu)”非法指令(内核转储)(venv)root@graphene-62:~/tensorflow#很乐意帮忙!你能把这个问题标记为已解决吗?