我正在尝试使用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
我做错了什么?到目前为止,我使用Python和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
我做错了什么?到目前为止,我使用Python和pip没有任何问题。
当前回答
唯一对我有用的是使用Ananconda并使用conda create -n tensorflow python=3.5创建一个新的conda env,然后使用activate tensorflow激活,最后使用conda install -c conda-forge tensorflow。
这可以解决我遇到的每个问题,包括ssl certs,代理设置,并且不需要管理员访问。需要注意的是,这并不是由tensorflow团队直接支持的。
源
其他回答
在Mac OS X Yosemite 10.10.5上使用Python 2.7对我来说是有效的:
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl
摘自tensorflow网站 https://www.tensorflow.org/install/install_windows
Installing with native pip If the following version of Python is not installed on your machine, install it now: Python 3.5.x from python.org TensorFlow only supports version 3.5.x of Python on Windows. Note that Python 3.5.x comes with the pip3 package manager, which is the program you'll use to install TensorFlow. To install TensorFlow, start a terminal. Then issue the appropriate pip3 install command in that terminal. To install the CPU-only version of TensorFlow, enter the following command:
C:\> pip3 install --upgrade tensorflow
To install the GPU version of TensorFlow, enter the following command:
C:\> pip3 install --upgrade tensorflow-gpu
告诉你具体是什么问题的方法是:
PIP install -vvv tensorflow
这将向您显示可用的轮子文件以及它们不匹配的原因。
如果你执行pip debug -verbose,它会显示所有兼容的标签。
在我的例子中,我试图在一个多通道ubuntu实例的m1 mac上安装tensorflow,而需要https://pypi.org/project/tensorflow-aarch64/
通过勾选“添加python到路径”来安装python Pip3安装——升级https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
这适用于windows 10.0
登录https://pypi.python.org/pypi/tensorflow查看哪些软件包可用。
在撰写本文时,他们还没有提供源包,因此如果没有为您的平台预先构建的源包,则会出现此错误。如果向pip命令行添加-v,您将看到它遍历PyPI上可用的包,并因不兼容而丢弃它们。
你需要在其他地方找到一个预先构建的包,或者根据https://www.tensorflow.org/install/install_sources上的说明从它的源代码编译tensorflow。
他们有充分的理由不为某些平台开发:
缺少一个win32包,因为TensorFlow的依赖项Bazel只支持win64。 对于win64,只支持3.5+,因为早期版本是用不支持c++ 11的编译器编译的。