Python 如何在 Windows 上降级已安装的“pip”版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24773109/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 05:10:28  来源:igfitidea点击:

How to downgrade the installed version of 'pip' on windows?

pythonwindows

提问by Alex

On a windows 7 machine I have pipversion 1.5.6 installed:

在 Windows 7 机器上,我pip安装了 1.5.6 版:

pip 1.5.6 from C:\Users\dietz\PNC\tas\ENV\lib\site-packages (python 2.7)

In order to find the reason for an error I want to install a different version of pip, which worked fine for me. So how can I uninstall pipand install version 1.2.1 instead?

为了找到错误的原因,我想安装不同版本的 pip,这对我来说很好用。那么我该如何卸载pip和安装 1.2.1 版呢?

采纳答案by Leonardo.Z

pipitself is just a normal python package. Thus you can install pip with pip.

pip本身只是一个普通的python包。因此,您可以使用 pip 安装 pip。

Of cource, you don't want to affect the system's pip, install it inside a virtualenv.

当然,您不想影响系统的 pip,请将其安装在 virtualenv 中。

pip install pip==1.2.1

回答by Maziyar Mk

If downgrading from pip version 10 because of PyCharm manage.py or other python errors:

如果由于 PyCharm manage.py 或其他 python 错误而从 pip 版本 10 降级:

python -m pip install pip==9.0.1