我正在尝试使用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没有任何问题。
当前回答
使用管理权限启动命令提示符 输入以下命令python -m pip install——upgrade pip 接下来输入命令pip install tensorflow
其他回答
如果你最近遇到了这个问题(比如,在2018年Python 3.7发布之后),这很可能是由于tensorflow方面缺乏Python 3.7支持造成的。如果您不介意,可以尝试使用Python 3.6。你可以从https://github.com/tensorflow/tensorflow/issues/20444上找到一些技巧,但使用它们的风险由你自己承担。我使用了harpone建议的方法——首先下载Python 3.6的tensorflow wheel,然后手动重命名它……
cp tensorflow-1.11.0-cp36-cp36m-linux_x86_64.whl tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whl
pip install tensorflow-1.11.0-cp37-cp37m-linux_x86_64.whl
好消息是,已经有了3.7支持的pull请求。希望能尽快发布。
我在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!
唯一对我有用的是使用Ananconda并使用conda create -n tensorflow python=3.5创建一个新的conda env,然后使用activate tensorflow激活,最后使用conda install -c conda-forge tensorflow。
这可以解决我遇到的每个问题,包括ssl certs,代理设置,并且不需要管理员访问。需要注意的是,这并不是由tensorflow团队直接支持的。
源
也有类似的问题
结果是默认的GPU版本,我已经在一个没有GPU的服务器上安装了它。
pip install --upgrade tensorflow-cpu
成功了
安装Python 3.5。x64位amd版本。确保将Python添加到PATH变量中。然后打开命令提示符并键入
python -m pip install --upgrade pip
应该会给你以下结果:
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
Successfully uninstalled pip-7.1.2
Successfully installed pip-9.0.1
现在式
pip3 install --upgrade tensorflow