[英]Pip Install Tensorflow Failed
I am trying to install tensorflow in python using pip command as pip install tensorflow
, but unfortunately, I received the following error: Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
I have also tried使用以下命令pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
,但再次遇到以下错误: tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform
。 此外,我已经针对 Python 版本 3.5x 3.6x 和显然 3.7 检查了相同的命令,但这些命令不起作用。
我认为 Tensorflow 目前不支持 Python 3.7,如果您当前安装了 Python 3.7,这可能是导致错误消息Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching distribution found for tensorflow
您可以降级到 Python 3.6.x,然后使用 pip 安装 tensorflow。
您确定您的大写/拼写正确吗? 命令提示符区分大小写。 我使用的输入是: cd C:\\path\\to\\the\\directory\\python\\is\\installed\\in
(cd, space, the path to the directory) then: python -m pip install TensorFlow
它应该在之后工作。
我在 Windows 10 上遇到了同样的问题,我发现 tensorflow 可以使用 python x64 安装,我使用的命令如下:
pip install --upgrade tf
目前,Tensorflow 适用于 64 位。
如果您想知道从哪里可以得到它: https : //www.python.org/downloads/windows/
选择 x84-64 版本(64 位)
在命令行上输入(如果您使用的是 GPU 版本)
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.0.0-cp35-cp35m-win_amd64.whl
或者如果您仅使用 CPU
pip install -U --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.0.0-cp35-cp35m-win_amd64.whl
相信如果大家都用了这个命令,问题总算解决了。
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.12.0-py3-none-any.whl
浏览pip 安装指南。 它描述了该过程,并强调了针对各种 python 版本和不同操作系统的解决方法。
我有一台带有 M1 芯片的 mac,安装说明略有不同。 我不得不使用 anaconda 来安装 TensorFlow。 确保您拥有具有 64 位架构的 python 版本 3.7+。
下载并安装Conda 环境。
chmod +x ~/Downloads/Miniforge3-MacOSX-arm64.sh
sh ~/Downloads/Miniforge3-MacOSX-arm64.sh
source ~/miniforge3/bin/activate
安装 TensorFlow 依赖项:
conda install -c apple tensorflow-deps==2.6.0
安装基础 TensorFlow:
python -m pip install tensorflow-macos
安装 tensorflow-metal 插件
python -m pip install tensorflow-metal
我在使用 MacOs M1 Ventura 13.1 时遇到了同样的问题,这解决了这个问题:
python3 -m pip install tensorflow-macos
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.