我正在尝试使用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没有任何问题。
当前回答
告诉你具体是什么问题的方法是:
PIP install -vvv tensorflow
这将向您显示可用的轮子文件以及它们不匹配的原因。
如果你执行pip debug -verbose,它会显示所有兼容的标签。
在我的例子中,我试图在一个多通道ubuntu实例的m1 mac上安装tensorflow,而需要https://pypi.org/project/tensorflow-aarch64/
其他回答
我在OSX Sierra 10.12.2上遇到了这个问题。原来我安装的Python版本是错误的(我安装的是Python 3.4,但OSX的tensorflow pypi包只适用于Python 3.5及以上版本)。
解决方案是安装Python 3.6。下面是我让它工作的方法。注意:我使用Homebrew来安装Python 3.6,你也可以使用python.org上的Python 3.6安装程序来安装
brew uninstall python3
brew install python3
python3 --version # Verify that you see "Python 3.6.0"
pip install tensorflow # With python 3.6 the install succeeds
pip install jupyter # "ipython notebook" didn't work for me until I installed jupyter
ipython notebook # Finally works!
使用管理权限启动命令提示符 输入以下命令python -m pip install——upgrade pip 接下来输入命令pip install tensorflow
似乎有很多原因导致tensorFlow不能通过pip安装。我在windows 10上遇到的一个问题是,我的系统路径中没有支持的cudnn版本。截至目前(2017年12月),windows上的tensorflow只支持cudnn v6.1。因此,提供cudnn 6.1的路径,如果其他一切都正确,那么应该安装tensorflow。
在Windows中安装TensorFlow的URL,下面是URL。这对我来说很有效。
python -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.0-py3-none-any.whl
我发现TensorFlow 1.12.0只适用于Python 3.5.2版本。我用的是Python 3.7,但它不起作用。所以,我不得不降级Python,然后我可以安装TensorFlow让它工作。
将python版本从3.7降级到3.6
conda install python=3.6.8