在macOS上安装pip不起作用(不再)

问题描述 投票:8回答:3

我按照在线说明如何在macOS上安装pip(例如thisthisthis)。

我似乎都很简单,但它对我不起作用。

我的python --version是2.7.10。

当我运行sudo easy_install pip时,我得到:

$ sudo easy_install pip
Password:
Searching for pip
Reading http://pypi.python.org/simple/pip/
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')

知道如何解决或解决这个问题吗?

python macos pip easy-install
3个回答
5
投票

使用brew for Macs

“brew install python”

这将带有pip以及python2和python3

绕过2个python版本(如果你想)的说明是在https://pip.readthedocs.io/en/stable/installing/

否则,它只是“python3 <'program'>”

以下是如何安装brew:https://www.howtogeek.com/211541/homebrew-for-os-x-easily-installs-desktop-apps-and-terminal-utilities/


4
投票

你可能有pip3。用它来升级点子。

pip3 install --upgrade pip

0
投票

easy_install已被弃用。请改用以下命令。

  1. curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  2. python get-pip.py

Source

© www.soinside.com 2019 - 2024. All rights reserved.