Installing pip using easy_install

Jac*_*ain 24 python pip easy-install

I don't have root access and i want to install python from scratch. So I downloaded the python source code and compiled it. Next I wanted to install pip. But when I ran python get-pip.py I got this error:

ImportError: cannot import name HTTPSHandler

Not having root access then I couldn't install stuff needed. So I thought maybe I can install pip with easy_install so I went and installed setuptools which has easy_install. But when I run easy_install pip I get this error:

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')
Run Code Online (Sandbox Code Playgroud)

So now how to install pip? I'm really going crazy!

Edit: I can't use virutalenv

Pri*_*ank 17

试试这个来安装pip:"easy_install-2.7 -U --user pip"

**another important info** 
Run Code Online (Sandbox Code Playgroud)

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

$ sudo apt-get install python-pip
Run Code Online (Sandbox Code Playgroud)

在Fedora上安装pip:

$ sudo yum install python-pip
Run Code Online (Sandbox Code Playgroud)

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

$ sudo yum install python-pip
Run Code Online (Sandbox Code Playgroud)

在Archlinux上安装pip:

$ sudo pacman -S python-pip
Run Code Online (Sandbox Code Playgroud)

  • 我没有root权限! (3认同)

jam*_*hid 8

这不正是回答原来的问题,但如果你不幸足以试图安装pipeasy_install上centos6,我希望这有助于.

这曾经工作但现在失败,出现以下错误:

$ docker run -ti centos:6 bash -c 'yum install -y python-setuptools && easy_install pip'
...
Installed:
  python-setuptools.noarch 0:0.6.10-3.el6                                                                                                                       

Complete!
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')
Run Code Online (Sandbox Code Playgroud)

我想http://pypi.python.org认真对待要求https.如果你做这个小小的黑客然后easy_install pip工作. sed --in-place 's#http://pypi.python.org#https://pypi.python.org#g' /usr/lib/python2.6/site-packages/setuptools/command/easy_install.py


use*_*719 5

对于那些没有 root 访问权限的人,这是我解决问题的方法。

  1. 下载 Python(压缩源 tarball)。

  2. 解压并cd到Python源目录。

  3. 使用“--with-ensurepip=install”标志进行配置,例如,

    ./configure --prefix=[your-specified-dir] --with-zlib-dir=/usr/lib64 --with-ensurepip=install
    
    Run Code Online (Sandbox Code Playgroud)
  4. 制作并安装

  5. 现在你应该有一个可以工作但过时的点。要获取最新的 pip,请下载get-pip.py文件并运行 python get-pip.py

现在您应该拥有最新的点。享受。:)