TensorFlow安装问题:安装的TensorFlow版本与python版本不匹配的问题&ImportError: DLL load failed

问题说明:

安装TensorFlow时候出现

You are using pip version 10.0.1, however version 21.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
这两个问题可以通过更新指令:

python -m pip install --upgrade pip -i https://pypi.douban.com/simple

解决。

如:

但是第一个红色问题依旧没有解决。

我找了很多方法,但是依旧没有解决,很多人说是python版本和TensorFlow不匹配的问题,CSDN用户:

醒了的追梦人说可以通过改变下载文档的名字解决:

将文件名:tensorflow-2.4.1-cp36-cp36m-win_amd64.whl

改为了:tensorflow-2.4.1-cp37-cp37m-win_amd64.whl 

但是好景不长,又遇到了一个新问题:

即:ERROR: Cannot uninstall 'wrapt'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

解决办法:

pip install wrapt --ignore-installed

让我再一次进行安装尝试吧

pip install tensorflow-2.4.1-cp37-cp37m-win_amd64.whl

结果如下

然而,当进行测试的时候又出现了这个问题:ImportError: DLL load failed:找不到指定的模块。

解决办法,应该是版本不匹配问题,重新安装了这个版本的。

pip install tensorflow==2.4

结果如下:

安装成功,测试一下吧。

找到

import tensorflow

3 感谢

醒了的追梦人:https://blog.csdn.net/qq_33472146/article/details/91846821

汤姆鱼:https://blog.csdn.net/weixin_41923658/article/details/96127770

VirgilG72: https://blog.csdn.net/weixin_43325818/article/details/86480384

猜你喜欢

转载自blog.csdn.net/a1456123a/article/details/115056768