2

I need to pip to work, however, since I'm developing on Python 2.7.5, pip isn't installed by default.

What I've tried:

Downloading get-pip.py, and then:

python get-pip.py

Unfortunately, that didn't work and I get the error

c:\users\myUser\appdata\local\temp\tmpd2l3rn\pip.zip\pip_vendor\urllib3\util\ ssl_.py:160: 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 t his. For more information, see https://urllib3.readthedocs.io/en/latest/advanced -usage.html#ssl-warnings

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirmi ng the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retr ies exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version '),)) - skipping Could not find a version that satisfies the requirement pip (from versions: ) No matching distribution found for pip

I also checked Christoph Gohlke's website and got these packages:

  1. Install setuptools
  2. Install pip

However, he doesn't seem to keep .msi/exe installers for either of these anymore (they are .whl)... Which leads me to the question: Can I install .whl Python packages without pip? How can I install pip if it is in a .whl? Am I missing something? is there something else I haven't tried?

  • `pip-18.0-py2.py3-none-any.whl` is a ZIP file. You can manually or scripted download the wheel, open it with an unzip program, and extract the `pip` and `pip-18.0.dist-info` folders to Python's `Lib\site-packages`. – cgohlke Aug 14 '18 at 17:44
  • This worked, however every pip command must be done via `python -m pip install package`. – Juan Sebastián Espinosa Aug 14 '18 at 21:26
  • On the other hand, @ANISH TIWARI's answer allowed me to use pip as a command, although I still get the error in the question, perhaps I could to install something else using easy_install? – Juan Sebastián Espinosa Aug 14 '18 at 21:29

2 Answers2

0

You can try doing

easy_install pip==18.0
ANISH TIWARI
  • 111
  • 1
  • 10
  • This worked, in a way, given cgohlke's comment, I managed to install both pip and setuptools with `python -m easy_install pip==18.0` Now I can use pip, however, I still get the error of the question everytime I try to install something with pip – Juan Sebastián Espinosa Aug 14 '18 at 21:49
  • [https://stackoverflow.com/questions/48780135/installing-pip-on-python-2-7-8-on-windows?rq=1] – ANISH TIWARI Aug 15 '18 at 15:18
-1

You can install pip from whl file with this command (put pip whl file name of file you have):

python pip-20.0.2-py2.py3-none-any.whl/pip install --no-index pip-20.0.2-py2.py3-none-any.whl

But pip will not functioning, not installing other packages! But with this command you can install other packages in whl format (replace second pip-20... with whl file you want to install)

  • Just note that the OP is asking for pip to actually _work_. This is likely to be resolved with some kind of answer that circumvents issues with the system trying to connect to the pip server using an old version of TLS. See https://github.com/pypa/pip/issues/4459. Try to find a way to add a trusted host to get-pip.py, similar to `pip install --upgrade --user pip --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org`. Then maybe upgrade the `requests` package to get support for later TLS versions. – Tyler Gannon May 04 '20 at 19:46