python - 使用 easy_install 安装 pip

标签 python pip easy-install

我没有 root 访问权限,我想从头开始安装 python。所以我下载了python源代码并编译了它。接下来我想安装 pip。但是当我运行 python get-pip.py 我得到了这个错误:

ImportError: 无法导入名称 HTTPSHandler

没有 root 访问权限,所以我无法安装所需的东西。所以我想也许我可以用 easy_install 安装 pip,所以我去安装了 setuptools,它有 easy_install。但是当我运行 easy_install pip 我得到这个错误:

Searching for pip
Reading https://pypi.python.org/simple/pip/
Download error on https://pypi.python.org/simple/pip/: unknown url type: https -- Some packages may not be found!
Couldn't find index page for 'pip' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: unknown url type: https -- Some packages may not be found!
No local packages or download links found for pip
error: Could not find suitable distribution for Requirement.parse('pip')

那么现在如何安装pip?我真的要疯了!

编辑:我不能使用 virutalenv

最佳答案

try this to install pip : "easy_install-2.7 -U --user pip"

**another important info** 

在 Ubuntu、Debian 或 Linux Mint 上安装 pip:

$ sudo apt-get install python-pip

在 Fedora 上安装 pip:

$ sudo yum install python-pip

要在 CentOS 上安装 pip,首先启用 EPEL 存储库,然后运行:

$ sudo yum install python-pip

在 Archlinux 上安装 pip:

$ sudo pacman -S python-pip

关于python - 使用 easy_install 安装 pip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26279207/

相关文章:

python-3.x - 无法为使用 PEP 517 且无法直接安装的 numpy 构建轮子

python - 将全局包包含到使用 --no-site-packages 创建的 virtualenv

python - 升级到 OS X Mavericks 后,easy_install 和 pip 损坏

python - 在 Windows 上安装 paramiko

python - 更改绘图的标记方向和图例位置

python - 为 PocketSphinx 的 Linux 安装创建模块?

Python setup.py install 指定 extras_require

python - Keras:无法访问 on_batch_end 回调内的训练图像

python - 在不占用 CPU 的情况下,在 App Engine 上执行大量 db.delete

python - 安装python3-dev时出现的问题