在自己的创建的虚拟环境目录下,执行下面两条命令,即可
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.