25

I tried following the instructions from this answer but easy_install-2.6 could not find pip:

>sudo easy_install-2.6 pip
Processing pip
error: Not a recognized archive type: pip

How do I install pip for python 2.6?

My root need for pip for 2.6 is explained in this thread.

Community
  • 1
  • 1
amphibient
  • 29,770
  • 54
  • 146
  • 240

4 Answers4

39

Just follow the instructions here:

  1. Securely download get-pip.py (this is the 2.6-specific file, link from Ricardo Iramar's answer).
  2. In the directory you saved get-pip.py, run

    sudo python2.6 get-pip.py
    

    and you'll be all set.

This will install pip for Python 2.6, and won't touch your version 2.7 installation.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • I'm getting this error when trying to run with Python 2.6: `AttributeError: 'module' object has no attribute 'WARNING'`. – bonh Mar 16 '17 at 17:38
  • I'm on ubuntu 16.04 LTS, this gives me error: 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 – paradox Oct 23 '17 at 22:16
  • If you don't have the super user permission, then use `--user` flag. – Nandha Kumar Apr 23 '18 at 04:52
  • 1
    python2.6: command not found is the error message I get when I try this – UKDataGeek Jun 09 '18 at 23:15
  • 6
    Note that the version of get-pip.py available via this link no longer supports Python 2.6. I believe it requires 2.7 and higher. See Ricardo's answer elsewhere on this page. – Mike Stoddart Jun 27 '18 at 19:40
  • I've tryed this and get this error message: ```pip._vendor.ipaddress.AddressValueError: 'XXX.XX.X.XX/XX' (len 14 != 4) is not permitted as an IPv4 address. Did you pass in a bytes (str in Python 2) instead of a unicode object?``` (erase the current ip, but there is one where the X's are) – Manuel Gijón Jan 15 '20 at 15:54
  • 1
    @MikeStoddart thanks, the link has been edited and clarified – MattDMo Feb 27 '20 at 15:05
34

Find below the steps to install pip on Python 2.6.X:

$ curl https://bootstrap.pypa.io/pip/2.6/get-pip.py -o get-pip.py
$ python get-pip.py
Neowizard
  • 2,981
  • 1
  • 21
  • 39
Ricardo.Iramar
  • 441
  • 4
  • 3
  • This worked, thanks, but just a note for others: current version still supports python 2.6, but future versions wont. pip command reports: *DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6* – Robert Lujo Dec 18 '17 at 16:20
  • This works better than above which was throwing an error – JackTheKnife Jan 30 '19 at 02:13
  • This should be the accepted answer for those of us still trying to support legacy systems :) – dsl101 Feb 15 '19 at 09:26
  • 1
    This gave me the following error: *InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this.* – rovyko Jan 21 '20 at 00:33
  • Thanks for the correct link. Someone added it to my answer and I've clarified that it's the 2.6-specific one. – MattDMo Feb 27 '20 at 15:07
  • 2
    `https://bootstrap.pypa.io/pip/2.6/get-pip.py` - Pradyun, on behalf of the volunteers who maintain pip. – lycanthrope10100 May 13 '21 at 12:43
6

on fedora/centos system, just use

yum install python-pip

on other linux system,use yum-like install tool

on window ,use the other solutions under this question

tsingroo
  • 189
  • 1
  • 3
1

From this page : pip

pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3, 3.4 and also pypy.

sudo apt-get install python-pip
DavidK
  • 2,495
  • 3
  • 23
  • 38
  • I do have pip installed but that works with python2.7 distro of python that is installed in parallel on my system with 2.6. i need to get pip to work with 2.6 – amphibient Jun 18 '14 at 20:34
  • 1
    Ok, maybe installing from source is the right way to do it; like MattDMo suggests it. – DavidK Jun 18 '14 at 20:41