ModuleNotFoundError: No module named 'rest_framework'

别说谁变了你拦得住时间么 提交于 2021-01-05 09:15:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!