pip could not find a version that satisfies the requirement django==2.2.1

Django versions 2 are compatible only with python3. So to install in your system install it with

pip3 install django

or if you want to create a virtual environment

python3 -m venv virtualenv
source virtualenv/bin/activate
pip install django (this installs with python3 pip)

It seems like you are using Python 2.7, and the last Django version to support Python 2 is Django 1.11. To use the newer Django versions you need to uprade to Python 3.

Chances are you already have Python 3 shipped with your Linux distro, you can check by running python3 in your shell. It is recommended that you create a virtual env for your project. You can create a Python 3 virtual env with the following command -

python3 -m venv env

Activate your env -

source ./env/bin/activate

Now you should be able to install newer Django version in your virtual env -

pip install django==2.2.1

This link might be of help in upgrading your Python version - https://docs.python-guide.org/starting/install3/linux/


Try with pip install -U django==2.2.1

Tags:

Linux

Django

Pip