问题
I'm trying to follow a tutorial on DRF, but when I'm about to run "migrate" for the database, i get ModuleNotFoundError: No module named 'rest_framework'.
As PyCharm hints, the same also applies to django_summernote and djoser I have there. I know there are some threads like this, but nothing from those seems to help - the Python console DOES recognize these modules, and they are added through INSTALLED_APPS
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'kursovik.apps.KursovikConfig',
'rest_framework',
'rest_framework.authtoken',
'django_summernote',
'djoser',
'kursovik']
I recently downloaded these through
pip install djangorestframework
pip install djoser
pip install django-summernote
do i need to reinstall them?
回答1:
You have to ensure that your PyCharm console uses the correct Python Path where the packages are available basically so to say.
Go to File/Settings/YourProject
and check for the following:
Set the correct path to make the packages available for interpretation procedures.
来源:https://stackoverflow.com/questions/62486199/modulenotfounderror-no-module-named-rest-framework