I\'ve installed django rest framework using pip install djangorestframework
yet I still get this error when I run \"python3 manage.py sycndb\":
To install it, do the following:
pip install djangorestframework
pip install markdown
pip install django-filter
We have to check for a few common mistakes:
check comma at installed list elements
typo errors
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 Windows
and then run the command again.
try this if you are using JWT pip install djangorestframework-jwt
In my case, my problem was different. I was creating in my bash_profile an alias like:
alias python=/usr/local/bin/python3
And even if I activate my environment, when I ran the command, the python interpreter accessed was from the system and not from my environment.
I just removed the alias from bash_profile and it worked fine.
Also, check for the possibility of a tiny typo:
It's rest_framework
with an underscore (_
) in between!
Took me a while to figure out that I was using a dash instead...
Try pressing the icon given if you are getting the following error:
"ModuleNotFoundError: No module named 'rest_framework'"
It will ask you to import the given package, that is rest_framework
and run the code again.
This worked for me and trying to solve that error for a couple of days.