Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django Rest Framework -- no module named rest_framework

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?

like image 914
tryingtolearn Avatar asked Oct 23 '15 18:10

tryingtolearn


3 Answers

You need to install django rest framework using pip3 (pip for python 3):

pip3 install djangorestframework

Instructions on how to install pip3 can be found here

like image 123
Vingtoft Avatar answered Nov 14 '22 23:11

Vingtoft


if you forget ,,this will happen,it's weird

wrong example: need a ,

INSTALLED_APPS = [
'rest_framework'
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
like image 67
rpstw Avatar answered Nov 15 '22 00:11

rpstw


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... 😅

like image 21
martin-martin Avatar answered Nov 15 '22 01:11

martin-martin