0

I currently have on Windows 10 Python 2.7.4 (32-bit) which doesn't have pip. Now I wish to have pip to install additional modules and for that a newer 2.7.x with pip is required. I already tried to install pip with 2.7.4 but it didn't work and other sources indicate it's not even supported. What's the best way to upgrade to the latest Python 2.7.x so that my Windows environment does not get messed up? Can I just delete the old Python27 directory and install the new version in it or should I run some uninstall first? Windows Apps & features list shows a couple of Python 2.7 modules which I've installed using .exe installers.

Note: The project requires Python 2.7.x, therefore upgrading to Python 3.7.x is not an option.

EDIT: I wish to upgrade Python also due to the error message outputted by get-pip.py which is directly telling a Python upgrade will solve it:

...\pip.zip\pip\_vendor\urllib3\util\ssl_.py:150: 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: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
epp
  • 161
  • 2
  • 8
  • 2
    Have you checked out the [official download for Python 2.7.16](https://www.python.org/downloads/release/python-2716/)? – Jordan Singer Mar 18 '19 at 15:35
  • 1
    Possible duplicate of [How do I install pip on Windows?](https://stackoverflow.com/questions/4750806/how-do-i-install-pip-on-windows) – quamrana Mar 18 '19 at 15:40
  • There's no official uninstall. If you're worried about your old Python executable sticking around, just search for any `python.exe` and get rid of them along with their enclosing directories. (I recommend using [Everything](https://www.voidtools.com/) instead of Windows native search) – Josh Friedlander Mar 18 '19 at 15:46

2 Answers2

0

If your preference is to have only one Python environment, try to uninstall the existing python installation from the Windows "Add or Remove Programs". When you install the latest Python 2.x, try to install it to the "Program Files" directory and don't use the version number for the installation directory (use "Python" instead of "Python27"). Another way is to get "Anaconda" with Python 2.x. Most of the current machines are with 64-bit OS. You should try a 64-bit installation file to get the most out of your OS.

Raj006
  • 562
  • 4
  • 18
0

As suggested by @Jordan Singer, I just installed Python 2.7.16 over the existing Python27 installation folder without uninstalling anything first. Now pip is working.

epp
  • 161
  • 2
  • 8