[Solved]-Django error cannot import name 'RemovedInDjango30Warning'


Comment out the following line:

from django.utils.deprecation import RemovedInDjango30Warning

in the files below:



This is caused by conflicts in Django versions as seen here.

ImportError: cannot import name ‘RemovedInDjango30Warning’

Try uninstalling django

sudo pip uninstall django

and reinstall with a version lower than 3.0

sudo pip install django==2.2


If you wish to use different versions of Django you can use virtual environments.

First create a requirements.txt example from here

You can generate your project’s requirements by running the pip freeze
command that lists all packages that are installed in your local
machine with their versions.

pip freeze > requirements.txt

Do note that this process can lead to certain unnecessary packages
being written to the requirements file which are installed in your
local machine but not required for the project. You must manually edit
the requirements file in that case.

Then create your virtual environment

Step 1 install virtualenv

pip install virtualenv

Step 2 create virtual enviroment

virtualenv env

Step 3 Activate your environment


When you wish to deacitvate


Step 4 Edit your requirements.txt to have the packages you’ll need for your project.

Step 5 install requirements.txt (in same dir)

pip install -r requirements.txt

Form infomation on deployment with mod_wsgi and Apache try here


This appears to be from a corrupt Django installation in site-packages. Remove Django and install it again.

For me, I was upgrading an existing project from Django 2.2.6 to 3.1.7. It appears that somehow files from 2.2.6 were still hanging around. I had to run pip uninstall django twice to get back to a clean slate and then pip install django to install the latest version.


This is caused by django versions. You probably upgraded it.

If you do not want to go back to version 2, create a virtual environment and do pip install django==2.2

👤Not Me


this error depends on python,pip and django versions.This error comes on mostly running latest django version on python2.

install python3 version

use commands like

pip3 install django

python3 manage.py runserver


I encountered the same problem.
this problem occur due to 2 version of python or django.
So, if you are running your project through virtual enviornment(venv), please check the python version in it.
By going in the following directly:


please ensure that x.y is that version of python whichyou are using in your project.
Or if you are not running your project through venv, please check the python version your project is using and running on.

python --version


I use django 4.1.4 and python 3.8.

pip3 uninstall django
rm ~/.local/lib/python3.8/site-packages/django/ -r
pip3 install django


I had two different versions of the Django framework in my virtual environment (versions 2.2 & 3.2) . I had to run twice:

pip3 uninstall django

Then i reinstalled the framework:

pip3 install django


i just wanna to say that when you have uninstalled django for some reasons, and when you install it once again you will may appear the problem,just add ‘class RemovedInDjango30warning:pass’ in django/utils/deprecation.py that’s it.


Leave a comment