pip版本过低,更新到更高版本的一种方法

在自己的创建的虚拟环境目录下,执行下面两条命令,即可
1、用pip卸载pip,虽然会报错,但是是可以卸载成功的

pip uninstall pip

2、用conda命令重新安装pip,并指定版本

conda install pip==21.3.1

ps:最好先设置成清华的镜像源,run以下命令

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

相关截图
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
这么做主要是因为它推荐的命令不管用,才出此下策

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

版权声明:本文为weixin_44946697原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。