Installing pip using easy_install

若如初见. 提交于 2019-11-30 10:55:26

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
jamshid

This isn't precisely answering original question but if you're unfortunate enough to be trying to install pip with easy_install on centos6, I hope this helps.

This used to work but now fails with below error:

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

I guess http://pypi.python.org got serious about requiring https. If you make this little hack then easy_install pip works. sed --in-place 's#http://pypi.python.org#https://pypi.python.org#g' /usr/lib/python2.6/site-packages/setuptools/command/easy_install.py

For those who have no root access, here is how I solved the issue.

  1. Download Python (Gzipped source tarball).

  2. Unzip and cd to the Python source directory.

  3. Configure with the "--with-ensurepip=install" flag, e.g.,

    ./configure --prefix=[your-specified-dir] --with-zlib-dir=/usr/lib64 --with-ensurepip=install
    
  4. make & make install

  5. Now you should have a working but out-dated pip. To get the latest pip, download the get-pip.py file and run python get-pip.py

Now you should have the latest pip. Enjoy. :)

Virtualenv to the rescue! It comes with pip, doesn't require root access, and allows you to have different environments each with their own copy of python, pip, and modules. The installation docs list several installation methods, you want the last one called "Use locally from source". Please also have a look at virtualenvwrapper, which is just a set of shell scripts that makes working with virtualenv easier. Google will produce ample tutorials on both of these.

pip installation is concern confirm with your python version in my case i m using python3 so i use following command and it works . let's try this

i am using MacOS

$ python3 get-pip.py

Gave me lot of trouble too but this worked for me:

python3 get-pip.py

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!