【发布时间】:2020-10-11 22:55:47
【问题描述】:
我正在尝试在 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)]
然后我去File > Settings > Project > Python Interpreter > Available Packages,找到并安装Tensorflow包。我安装了默认版本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 的设置说明进行操作:Link
更新 3:
所以我尝试通过包位置安装,但它不起作用(仅限 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 关注 instruction 时,在 Ubuntu 上一切正常。
【问题讨论】:
-
由于某种原因,在安装过程中似乎没有将版本传递给 pip。您是否尝试过使用 pip 手动安装 TensorFlow?
-
@PavelBotsman 我刚刚使用 cmd 安装了它,没有创建虚拟环境,它安装成功。你可以查看我的更新。
-
我建议使用
Python3.6安装Tensorflow。 -
@Saeed 我不能使用 Python 3.6,因为 TF 开发人员证书考试需要 Python 3.7。
标签: python tensorflow pycharm