Can't install Django v3.1 on system with v1.11.29

I have Ubuntu with Django version 1.11.29. I want version 3.1 (or 3.1.1). I type:

pip install Django==3.1.

I get:

“Could not find a version that satisfies the requirement Django==3.1. (from versions: 1.1.3, 1.1.4,…”
Same results with versions 3.1, 3.1.1, 3.1.2…

Second attempt: I type: “python -m pip install Django”

I get:

Collecting Django
Using cached https://files.pythonhosted.org/packages/49/49/178daa8725d29c475216259eb19e90b2aa0b8c0431af8c7e9b490ae6481d/Django-1.11.29-py2.py3-none-any.whl
Collecting pytz (from Django)
Using cached https://files.pythonhosted.org/packages/4f/a4/879454d49688e2fad93e59d7d4efda580b783c745fd2ec2a3adf87b0808d/pytz-2020.1-py2.py3-none-any.whl
Installing collected packages: pytz, Django
Successfully installed Django-1.11.29 pytz-2020.1

It’s the wrong version. How can I install Django 3.1.1?

Thanks!
Alan

First, verify that you’re using the Python 3 version of pip. Try pip3 install Django==3.1 or python3 -m pip install Django.

Depending upon which version of Ubuntu you’re running, it’s quite likely that Python 2 is the default. If so, in that case you’ll definitely want to work with a virtual environment. Set up a venv using Python 3, activate it, and work from there.

Ken

1 Like

It looks like you have a trailing . in your pip install command.