[英]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.