我正在尝试使用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没有任何问题。
当前回答
如果你试图在anaconda中安装tensorflow,但它不起作用,那么你可能需要降级python版本,因为只有3.6。目前支持X,而anaconda有最新版本。
检查python版本:python——version 如果>版本为3.6. exe。X则按照步骤3,否则停止,问题可能在其他地方 Conda搜索python Conda install python=3.6.6 再次检查版本:python——version 如果版本正确,安装tensorflow(步骤7) PIP安装tensorflow
其他回答
如果你正在使用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
根据TensorFlow安装页面,当运行pip install时,你需要使用——ignore-installed标志。
然而,在此之前,请参阅此链接 确保TF_BINARY_URL变量与你想要安装的TensorFlow版本相关的设置正确。
我可以在我的Mac上安装tensorflow-macos和tensrflow-metal
$ python -m pip install -U pip
$ pip install tensorflow-macos
$ pip install tensorflow-metal
唯一对我有用的是使用Ananconda并使用conda create -n tensorflow python=3.5创建一个新的conda env,然后使用activate tensorflow激活,最后使用conda install -c conda-forge tensorflow。
这可以解决我遇到的每个问题,包括ssl certs,代理设置,并且不需要管理员访问。需要注意的是,这并不是由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
如果您尝试了上面的解决方案,但没有解决问题,可能是因为版本不一致。
我安装了python 3.9,无法用pip安装tensorflow。
然后我卸载了3.9,然后安装了3.8.7,成功…tensorflow支持的最大版本是3.8。X(2021年) 所以,检查你的python版本是否与当前的tensorflow兼容。