How to install pip for python 2.6?
Asked Answered
J

4

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.

Jenellejenesia answered 18/6, 2014 at 20:27 Comment(0)
C
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.

Coachandfour answered 18/6, 2014 at 20:36 Comment(7)
I'm getting this error when trying to run with Python 2.6: AttributeError: 'module' object has no attribute 'WARNING'.Corrigan
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 availableDowntrend
If you don't have the super user permission, then use --user flag.Counterpoise
python2.6: command not found is the error message I get when I try thisYounger
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.Cuomo
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)Melena
@MikeStoddart thanks, the link has been edited and clarifiedCoachandfour
I
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
Interdiction answered 21/9, 2017 at 21:45 Comment(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.6Dysphemia
This works better than above which was throwing an errorCarabiniere
This should be the accepted answer for those of us still trying to support legacy systems :)Tingey
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.Fermium
Thanks for the correct link. Someone added it to my answer and I've clarified that it's the 2.6-specific one.Coachandfour
https://bootstrap.pypa.io/pip/2.6/get-pip.py - Pradyun, on behalf of the volunteers who maintain pip.Perception
Z
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

Zoe answered 5/11, 2015 at 6:24 Comment(1)
Hands down the easiest solution on CentOSIdolism
C
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
Cameroun answered 18/6, 2014 at 20:32 Comment(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.6Jenellejenesia
Ok, maybe installing from source is the right way to do it; like MattDMo suggests it.Cameroun

© 2022 - 2024 — McMap. All rights reserved.