使用pip找不到TensorFlow

本文讨论了使用pip安装TensorFlow时遇到的问题,包括TensorFlow未出现在PyPI中、Python位数不匹配、pip版本过低以及Windows上安装的Python版本要求。提到了解决方案,如指定TensorFlow的wheel文件URL、升级pip、确保使用64位Python 3.5及设置正确的TF_BINARY_URL变量。
摘要由CSDN通过智能技术生成

本文翻译自:TensorFlow not found using pip

I'm trying to intstall TensorFlow using pip: 我正在尝试使用pip安装TensorFlow:

$ pip install tensorflow --user
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

What am I doing wrong? 我究竟做错了什么? So far I've used Python and pip with no issues. 到目前为止,我使用Python和pip都没有问题。


#1楼

参考:https://stackoom.com/question/2dCjg/使用pip找不到TensorFlow


#2楼

Updated 11/28/2016: TensorFlow is now available in PyPI, starting with release 0.12. 2016年11月28日更新:从0.12版开始,PyPI中现已提供TensorFlow。 You can type 您可以输入

pip install tensorflow

...or... ...要么...

pip install tensorflow-gpu

...to install the CPU-only or GPU-accelerated version of TensorFlow respectively. ...分别安装仅CPU或GPU加速的TensorFlow版本。


Previous answer: TensorFlow is not yet in the PyPI repository, so you have to specify the URL to the appropriate "wheel file" for your operating system and Python version. 先前的答案: TensorFlow尚未存在于PyPI存储库中,因此您必须为操作系统和Python版本指定指向适当的“ wheel文件”的URL。

The full list of supported configurations is listed on the TensorFlow website , but for example, to install version 0.10 for Python 2.7 on Linux, using CPU only, you would type the following command: TensorFlow网站上列出了支持的配置的完整列表,但是例如,要仅使用CPU在Linux上为Python 2.7安装版本0.10,您可以键入以下命令:

$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp27-none-linux_x86_64.whl

#3楼

You need a 64-bit version of Python and in your case are using a 32-bit version. 您需要64位版本的Python,而您使用的是32位版本。 As of now Tensorflow only supports 64-bit versions of Python 3.5.x and 3.6.x on Windows. 到目前为止,Tensorflow在Windows上仅支持64-bit versions of Python 3.5.x and 3.6.x

To check which version of Python you are running, type python or python3 to start the interpreter, and then type import struct;print(struct.calcsize("P") * 8) and that will print either 32 or 64 to tell you which bit version of Python you are running. 要检查您运行的是哪个版本的Python,请键入pythonpython3来启动解释器,然后键入import struct;print(struct.calcsize("P") * 8) ,然后将输出3264来告诉您哪个位版本的Python正在运行。


#4楼

From tensorflow website: "You will need pip version 8.1 or later for the following commands to work". 从tensorflow网站上:“您将需要pip版本8.1或更高版本,以下命令才能起作用”。 Run this command to upgrade your pip, then try install tensorflow again: 运行以下命令以升级您的pip,然后尝试再次安装tensorflow:

pip install --upgrade pip

#5楼

If you are trying to install it on a windows machine you need to have a 64-bit version of python 3.5. 如果您尝试将其安装在Windows计算机上,则需要具有64位版本的python 3.5。 This is the only way to actually install it. 这是实际安装它的唯一方法。 From the website : 网站

TensorFlow supports only 64-bit Python 3.5 on Windows. TensorFlow在Windows上仅支持64位Python 3.5。 We have tested the pip packages with the following distributions of Python: 我们已经使用以下Python发行版对pip包进行了测试:

Python 3.5 from Anaconda Anaconda的Python 3.5

Python 3.5 from python.org. 来自python.org的Python 3.5。

You can download the proper version of python from here (make sure you grab one of the ones that says "Windows x86-64") 您可以从此处下载正确版本的python(确保您抓住显示“ Windows x86-64”的版本之一)

You should now be able to install with pip install tensorflow or python -m pip install tensorflow (make sure that you are using the right pip, from python3, if you have both python2 and python3 installed) 您现在应该可以使用pip install tensorflowpython -m pip install tensorflow进行python -m pip install tensorflow (如果同时安装了python2和python3,请确保使用的是来自python3的正确pip)

Remember to install Anaconda 3-5.2.0 as the latest version which is 3-5.3.0 have python version 3.7 which is not supported by Tensorflow. 请记住安装Anaconda 3-5.2.0作为3-5.3.0的最新版本,并安装Tensorflow不支持的python 3.7版本。


#6楼

If you are using the Anaconda Python installation, pip install tensorflow will give the error stated above, shown below: 如果您正在使用Anaconda Python安装,则pip install tensorflow将给出上述错误,如下所示:

Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow

According to the TensorFlow installation page, you will need to use the --ignore-installed flag when running pip install. 根据TensorFlow安装页面,运行pip install时需要使用--ignore-installed标志。

However, before this can be done see this link to ensure the TF_BINARY_URL variable is set correctly in relation to the desired version of TensorFlow that you wish to install. 但是,在执行此操作之前,请先查看此链接,以确保相对于希望安装的TensorFlow所需版本正确设置了TF_BINARY_URL变量。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值