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.

0

4 Answers 4

40

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.

7
  • I'm getting this error when trying to run with Python 2.6: AttributeError: 'module' object has no attribute 'WARNING'.
    – bonh
    Mar 16, 2017 at 17:38
  • I'm on ubuntu 16.04 LTS, this gives me error: File "get-pip.py", line 20061, in <module> 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, 2017 at 22:16
  • 1
    python2.6: command not found is the error message I get when I try this
    – UKDataGeek
    Jun 9, 2018 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. Jun 27, 2018 at 19:40
  • 1
    @MikeStoddart thanks, the link has been edited and clarified
    – MattDMo
    Feb 27, 2020 at 15:05
35

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
6
  • 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 Dec 18, 2017 at 16:20
  • This works better than above which was throwing an error Jan 30, 2019 at 2:13
  • This should be the accepted answer for those of us still trying to support legacy systems :)
    – dsl101
    Feb 15, 2019 at 9: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, 2020 at 0:33
  • 2
    https://bootstrap.pypa.io/pip/2.6/get-pip.py - Pradyun, on behalf of the volunteers who maintain pip. May 13, 2021 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

1
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
2
  • 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, 2014 at 20:34
  • 1
    Ok, maybe installing from source is the right way to do it; like MattDMo suggests it.
    – DavidK
    Jun 18, 2014 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.