question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue
  • 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.

Issue Analytics

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

github_iconTop GitHub Comments

4reactions
dicommented, Mar 20, 2018

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
2reactions
dstufftcommented, Mar 22, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install pip for python 2.6? - Stack Overflow
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,...
Read more >
Is there any way to install pip for Python 2.6? - Quora
In many Linux distributions, Python comes pre-installed, but pip does not. For example in Ubuntu 18.04 you can install pip using apt: sudo...
Read more >
Installation — pip 9.1.0.dev0 documentation - Read the Docs
Installing with get-pip.py¶. To install pip, securely download get-pip.py. [2]. Then run the following: python get ...
Read more >
How to Install PIP for Python on Windows - Liquid Web
Open a command prompt and navigate to the folder containing the get-pip.py installer. Run the following command: python get-pip.py. Pip should ...
Read more >
How to Install Pip on Windows - ActiveState
Click to install Python's standard package manager, Pip, on Windows and keep it updated. ... How to Install Pip with get-pip.py.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found