3

I'm trying to install pip for python 2.7.3 (unfortunately I don't have the choice of the python version I have to use) and when running get-pip.py (downloaded from the official website : https://pip.pypa.io/en/stable/installing/) with python 2.7.3 I get this message :

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

Martin
  • 105
  • 1
  • 10
  • 1
    Why do you have to use this version? Python 2.* is deprecated. – Guy Jan 12 '20 at 08:08
  • 2
    https://stackoverflow.com/questions/29099404/ssl-insecureplatform-error-when-using-requests-package – zvi Jan 12 '20 at 08:12
  • https://stackoverflow.com/search?q=%5Bpython-2.7%5D+A+true+SSLContext+object+is+not+available.+This+prevents+urllib3+from+configuring+SSL+appropriately – phd Jan 12 '20 at 12:43
  • @Guy I have to use this specific version because I'm creating tools for a specific DCC that provides their own python interpreter (which is python 2.7.3) compiled with a bunch of custom stuff, and the tools need to be portable without having to recompile the interpreter every time (because it ships by default with a sh**load of custom stuff) – Martin Jan 19 '20 at 18:26
  • @zvi Thank you, but I don't have a problem with requests, considering I don't even get to the step where I can install it. – Martin Jan 19 '20 at 18:35
  • @phd Thank you but all other topics are talking about requests (and all of them install it through pip) or solving the problem by changing python version, which, as I mention, I can do neither. – Martin Jan 19 '20 at 18:35
  • 1
    @Martin Python 2.7.9 is currently the lowest version to work with PyPI. If you really need 2.7.3 you have to install `pip` manually (not from PyPI) and you will have to download all wheels manually to install with `pip`. Download source code for [setuptools](https://pypi.org/project/setuptools/#files) and [pip](https://pypi.org/project/pip/#files), unpack and run `python setup.py install` – phd Jan 19 '20 at 19:21

1 Answers1

4

If you are using python 2.7.9 or above, pip is already installed. For lower versions of python you can install pip using below steps:

  1. Download get-pip.py scripy from here: https://bootstrap.pypa.io/get-pip.py
  2. Open the command prompt and navigate to get-pip.py file.
  3. Run the command python get-pip.py

After installing, you can check the pip version using python -m pip --version'. If you want to upgrade pip version you can runpython -m pip install --upgrade pip`

The SSL related warning you are getting while installing pip can be overcome by either upgrading to latest version of python 2.7 or following the instructions given here: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings. These warnings are relevant to you if you are handling some urls in your python script.

krishna
  • 136
  • 6
  • 1
    Thank you, but again, as I mentioned, I cannot use a different version of python, and your steps are PRECISELY what I'm doing and what goes wrong. – Martin Jan 19 '20 at 18:36