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
  • 307
  • 2
  • 7
  • 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

2 Answers2

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
  • 665
  • 7
  • 20
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
  • 82,685
  • 13
  • 120
  • 165