Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install pip with python 2.6 on Windows

Tags:

pip

python-2.6

Im attempting to install pip with python 2.6 on my dev machine to try to match a deployment environment that also uses python 2.6.

Python 2.6 is installed OK. I've tried installing pip using get-pip.py as outlined here https://pip.pypa.io/en/stable/installing/ with the version of the get-pip.py script from https://bootstrap.pypa.io/2.6/get-pip.py

However it fails with the following:

C:\users\me> python get-pip.py
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.6
Collecting pip<10
c:\users\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject 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\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: 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
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\me\appdata\local\temp\tmpcdimtd\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: 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.python.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:490: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping
  Could not find a version that satisfies the requirement pip<10 (from versions: )
No matching distribution found for pip<10

Obviously, upgrading to newer python defeats my purpose.

The information at the URL recommended for the warning InsecurePlatformWarning suggests that I install more things using pip... >.<

PS I've tried using easy-install from setuptools-40.0.0 as well, but I could not get this to work. I'm not sure if I'm using it correctly as the setuptools installation documentation has circular links (from the documentation to Pypi, back to the documentation)

like image 225
Toby Avatar asked Jul 27 '18 15:07

Toby


People also ask

Does Python 2.6 have pip?

pip works with CPython versions 2.6, 2.7, 3.1, 3.2, 3.3, 3.4 and also pypy.

How do I install Python-pip on Windows?

Step 1: Download the get-pip.py (https://bootstrap.pypa.io/get-pip.py) file and store it in the same directory as python is installed. Step 2: Change the current path of the directory in the command line to the path of the directory where the above file exists. Step 4: Now wait through the installation process. Voila!

Does Python 2.7 have pip?

If you're using Python 2.7. 9 (or greater), 3.4 (or greater), then PIP is already built into the Python installer.

Does Python 2.7 15 have pip?

PIP is automatically installed with Python 2.7. 9+ and Python 3.4+ and it comes with the virtualenv and pyvenv virtual environments. Before you install PIP on Windows, check if PIP is already installed.


1 Answers

For Python 2.6 you need older setuptools. The last setuptools version that works with Python 2.6 is 36.8.

Download setuptools-36.8.0.zip, unpack and run python2.6 setup.py install.

After that get-pip.py should install pip for you.

The last version of pip supporting Python 2.6 is 9.0.3: https://pypi.org/project/pip/9.0.3/#files

like image 123
phd Avatar answered Jan 04 '23 01:01

phd