Django Rest Framework — No Module Named Rest_framework

1.2K    Asked by Aalapprabhakaran in Devops , Asked on Nov 21, 2022

I've installed django rest framework using pip install djangorestframework yet I still get this error when I run "python3 manage.py syncdb":

ImportError: No module named 'rest_framework'
I'm using python3, is this my issue?
Answered by Aashna Saito

Maybe you installed DRF for python2, not for python3. That is why you are receiving the modulenotfounderror: no module named 'rest_framework'


You can use python console to check your module:
import rest_framework
Actually if you use pip to install a module, it will install the python2 module.
You should install the pip for python3:
sudo apt-get install python3-setuptools
sudo easy_install3 pip
So, you can install the python3 module.

Your Answer

Interviews

Parent Categories