Python 如何通过简易安装安装特定版本的 pip?- Mac OS 小牛队

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25942386/
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-18 23:50:43  来源:igfitidea点击:

How can I install a specific version of pip via easy-install? - Mac OS Mavericks

pythonmacospipeasy-install

提问by currysensei

I am constantly getting the

我不断得到

Cannot fetch index base URL https://pypi.python.org/simple/

whenever I try to pip install anything with the most recent pip version.

每当我尝试使用最新的 pip 版本安装任何东西时。

I read on some other questions that pip was having SSL related issues in its latest version and recommended to install pip 1.2.1.

我阅读了一些其他问题,即 pip 在其最新版本中存在 SSL 相关问题,并建议安装 pip 1.2.1。

How do I install a specific version of pip via easy_install for example?

例如,如何通过 easy_install 安装特定版本的 pip?

回答by Rainy

You should be able to install pip with pip:

您应该能够使用 pip 安装 pip:

pip install --upgrade pip==1.2.1

回答by salmanwahed

Uninstall any previous installation of pip. Considering you are using system wide installation,

卸载任何以前安装的pip. 考虑到您正在使用系统范围的安装,

sudo apt-get remove python-pip

and also,

并且,

pip uninstall pip

Now,

现在,

sudo apt-get install python-setuptools
sudo easy_install pip==<specific version>
sudo pip install virtualenv

It's preferred to use virtual environmentthough.

virtual environment不过最好使用。

回答by Owen Roth

Based on your context, you can uninstall as above and then run:

根据您的上下文,您可以按上述方式卸载,然后运行:

sudo easy_install pip==1.2.1

No more pesky SSL errors.

不再有讨厌的 SSL 错误。