python版本低,安装TensorFlow错误

@python版本低,安装TensorFlow错误

标题

python版本低,安装TensorFlow错误

C:\Users\administrator>pip install tensorflow
ERROR: Could not find a version that satisfies the requirement tensorflow (from
versions: none)
ERROR: No matching distribution found for tensorflow
WARNING: There was an error checking the latest version of pip.

python.exe -m pip install --upgrade pip
pip install --upgrade pip

后再pip install tensorflow 仍然如上提示。这是因为python 版本低。

C:\Users\administrator>python
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Inte
l)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

升级到Python 3.8.9
C:\Users\administrator>python
Python 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 14:02:34) [MSC v.1928 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

再安装 pip install tensorflow -i https://pypi.tuna.tsinghua.edu.cn/simple 成功

可以使用以下命令来检查 TensorFlow 是否已经正确安装:

python -c “import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))”

如果没有报错,则说明 TensorFlow 已经正确安装。

你可能感兴趣的:(python)