pip: can't install pip in Python 2.6.* by using get-pip.py

  • Pip version: maybe 9.0.2
  • Python version: 2.6.6
  • Operating system: macOS 10.13.3

Description:

I’ve installed python 2.6.6 from source code and I tried to install pip using get-pip.py downloaded drom https://bootstrap.pypa.io/get-pip.py However, it cannot be installed because of the following error:

Traceback (most recent call last):
  File "get-pip.py", line 22373, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
  File "/path/pip.zip/pip/__init__.py", line 34, in <module>
AttributeError: 'module' object has no attribute 'OPENSSL_VERSION_NUMBER'

As you may know, OPENSSL_VERSION_NUMBER is introduced to python at 2.7, so actually the following part won’t work: https://github.com/pypa/pip/blob/master/src/pip/_internal/__init__.py#L27-L39

Actually I found it when I tried to install python 2.6.6 by using pyenv. If you have already not supported these versions, I think I have to let the developers of pyenv know these bug because currently we cannot at all install python 2.6.* by using pyenv.

So, I want to ask pip developers: First of all, Is this a bug of pip-side? If not, do you think that it is a correct way to fix or adjust pyenv-side?


I found Installation Guide said:

Python and OS Compatibility
pip works with CPython versions 2.6, 2.7, 3.3, 3.4, 3.5 and also pypy.

Therefore I think it is not reasonable that we cannot install python 2.6.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 21 (17 by maintainers)

Commits related to this issue

Most upvoted comments

I was able to resolve this by pointing it at the version of get-pip.py in this commit to pypa/get-pip from 2016:

$ export GET_PIP_URL=https://github.com/pypa/get-pip/raw/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py

$ pyenv install 2.6.9
python-build: use openssl from homebrew
python-build: use readline from homebrew
Installing Python-2.6.9...
patching file setup.py
Hunk #1 succeeded at 354 (offset 9 lines).
patching file ./configure
patching file ./Modules/readline.c
Hunk #1 succeeded at 199 (offset -7 lines).
Hunk #2 succeeded at 698 (offset -51 lines).
Hunk #3 succeeded at 808 (offset -51 lines).
Hunk #4 succeeded at 848 with fuzz 2 (offset -70 lines).
patching file ./setup.py
Hunk #1 succeeded at 1698 (offset 23 lines).
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
python-build: use readline from homebrew
Installing pip from https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py...
Installed Python-2.6.9 to /Users/di/.pyenv/versions/2.6.9

$ python2.6 --version
Python 2.6.9

This is fixed in pip 9.0.3 and get-pip.py will be updated shortly.

Nah, I’ll try to get a 9.0.3 out sometime today.

IMO, If the future pip does not support python 2.6, it might be a bit difficult to merge #5097 , but thank you for the work @Happyholic1203