如何在 Mac 上安装 Python 的 pip3? [英] How can I install Python's pip3 on my Mac?

查看:83
本文介绍了如何在 Mac 上安装 Python 的 pip3?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

sudo easy_install pip3密码:寻找 pip3阅读 https://pypi.python.org/simple/pip3/找不到pip3"的索引页(可能拼写错误?)扫描所有包的索引(这可能需要一段时间)阅读 https://pypi.python.org/simple/找不到 pip3 的本地包或下载链接错误:找不到 Requirement.parse('pip3') 的合适发行版

解决方案

UPDATED - Homebrew version after 1.5

根据官方 Homebrew 页面:

<块引用>

在 2018 年 3 月 1 日,python 公式将升级到 Python 3.x,并且将添加一个 python@2 公式以安装 Python 2.7(尽管这将仅用于桶,因此 python 和 python2 都不会添加到 PATH默认情况下没有手动 brew 链接 --force).我们将维护 python2、python3 和 python@3 别名.

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

brew install python3

然后,pippip3会自动安装,你可以通过pip install 安装任何包.>


较旧版本的 Homebrew

不仅brew install python3,还有brew postinstall python3

所以你必须运行:

brew install python3酿造后安装python3

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

I'm trying to install pip3, but I'm not having any luck. Also, I tried sudo install and it did not work. How could I install pip3 on my Mac?

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')

解决方案

UPDATED - Homebrew version after 1.5

According to 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.

So to install Python 3, run the following command:

brew install python3

Then, the pip or pip3 is installed automatically, and you can install any package by pip install <package>.


The older version of Homebrew

Not only brew install python3 but also brew postinstall python3

So you must run:

brew install python3
brew postinstall python3

Note that you should check the console, as it might get you errors and in that case, the pip3 is not installed.

这篇关于如何在 Mac 上安装 Python 的 pip3?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆