1

I have python 2.7 installed on my machine globally and the pip version is pip 20.3.4. I want to install Django version 1.11.22. When I am trying to do so with pip install Django==1.11.22, I am getting the error as mentioned in the picture. This is not just while installing Django, I am getting the same error while installing anything like pip install openpyxl.

enter image description here

Adii_Mathur
  • 38
  • 1
  • 5
  • 3
    As the error says, since January 1st 2020, Python-2.x is no longer supported, and pip dropped support one year later. – Willem Van Onsem Nov 10 '21 at 18:56
  • So does that mean that there is no way of installing anything with python 2.7 as my interpreter because I am working on a web app that is dependent on this particular python version and it is not possible to migrate the app to python 3. Is there any way I can work with python 2.7 and install anything?? – Adii_Mathur Nov 10 '21 at 19:00
  • 2
    Python 2.7 is no longer supported or secure. I’m sorry, but don’t run it. NOTHING should be dependent on Python 2.7, especially anything web facing! – FlipperPA Nov 10 '21 at 19:09
  • @Adii_Mathur Where from have you installed Python 2.7? Some Windows shop? chocolatey? or from python.org? PS. I'm sure it's still possible to install Python 2.7, pip and Django. There is nothing wrong in installing and using "not supported" Python. – phd Nov 10 '21 at 20:29
  • @phd could you please tell me how that can be done with getting any error because I have tried everything but nothing seems to work – Adii_Mathur Nov 11 '21 at 03:53
  • i got the python installation file from python.org and the exact version of python is 2.7. – Adii_Mathur Nov 12 '21 at 04:16
  • @phd thank you so much, I was able to make it work without creating a virtual environment as well with python 2.7.5. Thanks for the help. – Adii_Mathur Nov 12 '21 at 12:02
  • @Adii_Mathur I made it an answer. – phd Nov 12 '21 at 12:10

3 Answers3

0

enter image description here As the error says and @Willem Van Onsem said, python 2.7 is no longer support, you can't install it nowadays

Bernardo Olisan
  • 553
  • 4
  • 14
0

You update your pyhon and also pip ....

If you are switching between two major releases, for example 2.7.x to 3.3.x: Keep them side by side. They will be installed in different directories, named after their version. Have your PATH variable point to the older version and link the shortcut to newer version (python.exe in installation folder). If you are switching between two minor releases, just install one over the other. Download latest version from their website and run it. It will remove the previous version and update automatically. You can also install a major release over a minor release without keeping it, just make sure your path variable is pointing to the right thing. I started pretty late, so I have been using version 3.x from the start.

Oh, and do look at the changes they made moving from 2.7.x to 3.3.x, you might wanna work with both.

More information can be found here: How to update Python?

if your just updating pip, the install library, that’s a different matter that can be done by:

python -m pip install --upgrade pip 

its my experience that the people who programmed the IDE know more about its function than you and thus, just let them control the install process (through the installer).

Biswajit Paloi
  • 569
  • 1
  • 13
0

The latest version Python 2.7.18 should work fine. Install it with pip enabled or install pip after using python -m ensurepip. Upgrade pip:

pip install --upgrade "pip<21.0" "setuptools<45"

Install virtualenv:

pip install --upgrade "virtualenv<20"

Create a virtual environment (very much recommended) somewhere and activate it:

virtualenv django-venv
django-venv\Scripts\activate.

Install Django (can be done without a virtual environment):

pip install --upgrade "Django==1.11.22".

Remember to activate the virtual environment (if you use it) every time you open a new terminal.

phd
  • 69,888
  • 11
  • 97
  • 133