【Bug】WARNING: There was an error checking the latest version of pip.

目录

一、问题

二、报错原因

三、解决方法

四、总结


一、问题

今天用pip安装第三方模块的时候发生了如下的报错问题:

WARNING: There was an error checking the latest version of pip.

报错内容翻译:

警告:检查最新版本的pip时出错。

二、报错原因

需要升级pip版本才可以安装其他模块。

说白了就是让你把pip的版本升级为最新的就可以了。

三、解决方法

快速解决——一行代码:

python -m pip install -U --force-reinstall pip

反正我是直接运行上面的代码就直接成功解决了。

如果上面代码未能解决问题的话,那就解决看下面的解决步骤吧:

1.关闭VPN

 2,以管理员身份运行命令行

 快捷键:Ctrl + Shift + Enter

3,升级pip

选择以下任意一个命令运行即可。

命令1

python.exe -m pip install --upgrade pip

命令2

python -m pip install --upgrade pip

命令3

pip install --upgrade pip

命令4

 python3 -m pip install --upgrade pip

命令5

 python -m pip install -U --force-reinstall pip

大家可以看到,我运行命令后又出现了新的错误。

ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip

具体解决方法请大家看这篇博客:【Bug】ERROR: Could not find a version that satisfies the requirement pip (from versions: none)

现在我们只需要在命令的最后加上一个镜像源就可以了,最终代码如下:

python -m pip install -U --force-reinstall pip -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

这样就运行成功了。

下面我们再来验证一下:

至此,问题得以解决。

四、总结

未能解决的可能原因:

  1. 没有关闭VPN
  2. 没有以管理员身份运行cmd
  3. 没有添加镜像源
  4. 命令没有输入正确
  5. 没有重新打开命令行窗口
  6. python环境有问题
  7. 没有连接网络
  8. 重启电脑

猜你喜欢

转载自blog.csdn.net/m0_63636799/article/details/130022669