在安装第三方库时,出现如下提示:

You are using pip version 10.0.1, however version 20.2.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

 

 

 然后按照提示升级操作,又提示我已经是最新版本。还提示我添加上--trusted-host mirrors.aliyun.com命令试试

 

 

 其实这样也解决不了问题。根本原因是在python第三方库中已经存在了pip-20.2.2.dist-info,而且你会发现pip-10.0.1也存在该目录。可能是pip20.2.2在安装时失败或超时,文件已经存在导致不能正常升级。

删除pip-20.2.2.*

重新执行命令:python -m pip install --upgrade pip --index-url http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

然后发现正常安装成功。