I've installed django rest framework using pip install djangorestframework
yet I still get this error when I run "python3 manage.py sycndb":
ImportError: No module named 'rest_framework'
I'm using python3, is this my issue?
I've installed django rest framework using pip install djangorestframework
yet I still get this error when I run "python3 manage.py sycndb":
ImportError: No module named 'rest_framework'
I'm using python3, is this my issue?
When using a virtual environment like
virtualenv
without having django-rest-framework installed globally you might as well have the error. The solution would be:activate the environment first with
{{your environment name}}/bin/activate
for Linux or{{your environment name}}/Scripts/activate
for Windowsand then run the command again.
You need to install django rest framework using pip3 (pip for python 3):
Instructions on how to install pip3 can be found here
try this if you are using JWT
pip install djangorestframework-jwt
I know there is an accepted answer for this question and many other answers also but I just wanted to add an another case which happened with me was Updating the django and django rest framework to the latest versions to make them work properly without any error.
So all you have to do is just uninstall both django and django rest framework using:
pip uninstall django
pip uninstall djangorestframework
and then install it again using:
pip install django
pip install djangorestframework
if you forget
,
,this will happen,it's weirdwrong example: need a
,
Maybe you install DRF is for python2, not for python3.
You can use
python console
to check your module:Actually you use
pip
to install module, it will install python2 module.You should install the pip for python3:
So, you can install python3 module.