[英]Cannot install Tensorflow with Pycharm because of Protobuf error
[英]Cannot install Tensorflow on PyCharm
我正在嘗試在Project > Python Interpreter
中的 PyCharm 上安裝 TensorFlow 以滿足 TF 開發人員證書考試的要求。
我的電腦是 Windows 10。在Python Console
上,我打印 python 版本:
>>> print(sys.version)
3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)]
Then I go to File > Settings > Project > Python Interpreter > Available Packages
, find and install the Tensorflow package. 我安裝了默認版本,即2.2.0
。 我的pip
版本是20.1.1
。
但我無法安裝它,它顯示此錯誤:
Error occurred:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
Command output:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
我已經搜索了這個解決方案,但我找不到任何可以幫助我解決它的東西。 有誰知道如何解決這一問題? 謝謝。
更新:當我在 cmd 中安裝 TF 時,它安裝成功。
C:\Users\User>pip show tensorflow
Name: tensorflow
Version: 2.2.0
Summary: TensorFlow is an open source machine learning framework for everyone.
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: packages@tensorflow.org
License: Apache 2.0
Location: c:\users\user\anaconda3\lib\site-packages
Requires: six, google-pasta, wrapt, astunparse, gast, wheel, scipy, absl-py, numpy, tensorboard, termcolor, grpcio, h5py, keras-preprocessing, tensorflow-estimator, protobuf, opt-einsum
Required-by:
更新 2:
我遵循 TF 的設置說明: 鏈接
更新 3:
所以我嘗試通過 package 位置安裝,但它不起作用(僅限 Python 3.7 CPU):
pip install https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow_cpu-2.2.0-cp37-cp37m-win_amd64.whl
錯誤:
ERROR: tensorflow_cpu-2.2.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
更新 4:
我創建了一個新項目,然后使用conda
環境安裝 TF。 然后它工作。
但我仍然不明白為什么使用普通venv
,它無法安裝。
更新 5:
遵循 TF 的指令時,Ubuntu 一切正常。
當我嘗試在 Windows 10 上使用 TensorFlow 並安裝多個版本的 Python 時遇到了這個問題。
我所做的是卸載除最新版本之外的所有版本。 如果我需要舊版本,我會使用Conda虛擬環境。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.