Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong

Here's my settings.py:

INSTALLED_APPS = [
    'rest_framework',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'api.apps.ApiConfig'
]
like image 681
Harshil Gambhir Avatar asked Nov 27 '22 05:11

Harshil Gambhir


1 Answers

If you are using VSCode, Ctrl + Shift + P -> Type and select 'Python: Select Interpreter' and enter into your projects virtual environment. This is what worked for me.

like image 177
nayburz Avatar answered Nov 29 '22 19:11

nayburz