如何在我的Mac上安装pip3?

2024-04-25 00:06:53 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试安装pip3,但我没有任何运气。另外,我尝试了sudo install,但没有成功。如何在Mac上安装pip3?

sudo easy_install pip3
Password:
Searching for pip3
Reading https://pypi.python.org/simple/pip3/
Couldn't find index page for 'pip3' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/

No local packages or download links found for pip3
error: Could not find suitable distribution for Requirement.parse('pip3')

Tags: installhttpsorgpypiforindexmacpackages
3条回答

你可以用home-brew

然后就跑:

brew install python3

我用这些命令解决了同样的问题:

curl -O https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py

更新-1.5之后的自制版本

根据the official Homebrew page

On 1st March 2018 the python formula will be upgraded to Python 3.x and a python@2 formula will be added for installing Python 2.7 (although this will be keg-only so neither python nor python2 will be added to the PATH by default without a manual brew link --force). We will maintain python2, python3 and python@3 aliases.

因此,要安装Python 3,请运行以下命令:

brew install python3

然后,自动安装pippip3,您可以通过pip install <package>安装任何包。


老版本的自制酒

不仅brew install python3,而且brew postinstall python3

所以你必须跑:

brew install python3
brew postinstall python3

注意,您应该检查控制台,因为它可能会给您带来错误,在这种情况下,pip3没有安装。

相关问题 更多 >