我正在尝试使用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没有任何问题。
当前回答
至少在我写这篇文章的时候(2020年12月),Tensorflow不支持3.8之后的python版本。使用这个:https://www.tensorflow.org/install来检查它支持哪些python版本,我只是花了几个小时来查看这些答案,花了我很长时间才意识到这一点。
其他回答
我在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!
也有类似的问题
结果是默认的GPU版本,我已经在一个没有GPU的服务器上安装了它。
pip install --upgrade tensorflow-cpu
成功了
以下是我为Windows 10所做的!我也没有打扰之前的Python 2.7安装
步骤1:从链接安装Windows x86-64可执行安装程序: https://www.python.org/downloads/release/python-352/
步骤2:以管理员身份打开cmd
步骤3:输入以下命令:
pip install https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
您应该看到它可以正常工作,如下图所示,我还尝试了示例示例。
在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
我也有同样的问题。在卸载32位版本的python并重新安装64位版本后,我尝试重新安装TensorFlow,它工作了。
TensorFlow指南链接:https://www.tensorflow.org/install/install_windows