2

I have two version of Python in my Linux system /usr/bin/python2.6 /usr/local/bin/python2.7

I want to install pip under python2.7 but it is getting automatically installed under /usr/lib/python2.6/site-packages instead of /usr/local/lib/python2.7/site-packages.

**[root@sandbox site-packages]# which pip
/usr/bin/pip
[root@sandbox site-packages]# pip -V
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)**

I think there is some issue with two version of python present in Linux. How can i forcibly install pip under python2.7 ?

Can someone help me resolve this ?

sims.2990
  • 31
  • 1
  • 6
  • Did you try removing `pip` completely, updating your repositories, and reinstalling it? – Ziyad Edher Apr 07 '17 at 07:14
  • Possible duplicate of [how to use python2.7 pip instead of default pip](http://stackoverflow.com/questions/26266437/how-to-use-python2-7-pip-instead-of-default-pip) –  Apr 07 '17 at 07:20
  • @Wintro - Yes i tried to remove pip using following comand: sudo yum remove python-pip and am installing pip using this command:sudo yum install python-pip python-dev build-essential but it is getting installed under python2.6 – sims.2990 Apr 07 '17 at 07:32
  • @Sergei : i tried to follow step in the link mentioned but i am getting following error: sudo /usr/local/bin/python2.7 get-pip.py Traceback (most recent call last): File "get-pip.py", line 20061, in main() File "get-pip.py", line 194, in main bootstrap(tmpdir=tmpdir) File "get-pip.py", line 82, in bootstrap import pip zipimport.ZipImportError: can't decompress data; zlib not available – sims.2990 Apr 07 '17 at 07:40

1 Answers1

0

You can try this:

/the/path/to/your/python2.7 -m pip install *your-packages*

Regards, Ed

Edward Zhang
  • 117
  • 1
  • 2