0

While trying to install pip i got this error, how do i solve it without upgrading to a new python version?

PS C:\Users\Eduardo\Downloads> python .\get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:380: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:139: 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. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:139: 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. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:139: 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. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:139: 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. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:139: 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. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\eduardo\appdata\local\temp\tmp_vvl1t\pip.zip\pip\_vendor\urllib3\util\ssl_.py:139: 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. 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 confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:507: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip
Eduardo
  • 29
  • 3
  • This link might help. https://stackoverflow.com/questions/41238786/error-no-matching-distribution-found-for-pip – VeryBhatti Apr 09 '20 at 11:34
  • Which SO are you using? – Henrique Branco Apr 09 '20 at 11:38
  • @HenriqueBranco Windows 10 – Eduardo Apr 09 '20 at 11:40
  • See [this issue](https://github.com/pypa/pip/issues/5448#issuecomment-395000804) to avoid SSL error. Try to use `--trusted-host pypi.org --trusted-host files.pythonhosted.org` options. Generally, best practice for any Python project is to _use a virtual environment_. So I would suggest: 1. create a virtual environment 2. source the virtual environment 3. `pip` is already installed, you need to upgrade it with `pip install pip --upgrade` and do the same for `setuptools` – tuned Apr 09 '20 at 12:59
  • @Eduardo, did you follow the steps in [pip installation docs](https://pip.pypa.io/en/stable/installing/)? – Henrique Branco Apr 09 '20 at 13:12

1 Answers1

1

Try to use curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py as mentioned in https://pip.pypa.io/en/stable/installing/ In other alternative, you could try and run the same command with user permissions adding sudo, like this:

sudo python get-pip.py

Hope it helps!

  • Try to install it in your home directory, instead of a folder within your home directory. – Diogo Lopes Apr 09 '20 at 12:06
  • If that doesn't work as well, you have two options: install an newer version like Python 3.6.9 or try: **pip install pip** or even **sudo apt-get install python-minimal** – Diogo Lopes Apr 09 '20 at 12:09
  • Yes, I think sudo apt-get install python-minimal installs 2.7.12, because 2.7.6 is probably a version with fewer support and packages nowadays. – Diogo Lopes Apr 09 '20 at 12:13