繁体   English   中英

无法在 PyCharm 上安装 Tensorflow

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM