Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

python - Installing pip using 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')

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

Edit: I can't use virutalenv

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

**another important info** 

To install pip on Ubuntu, Debian or Linux Mint:

$ sudo apt-get install python-pip

To install pip on Fedora:

$ sudo yum install python-pip

To install pip on CentOS, first enable EPEL repository, and then run:

$ sudo yum install python-pip

To install pip on Archlinux:

$ sudo pacman -S python-pip

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...