movieweb_python icon indicating copy to clipboard operation
movieweb_python copied to clipboard

ImportError: No module named rest_framework

Open EE1437 opened this issue 7 years ago • 2 comments

你好,运行开发服务器python manage.py runserver的时候报错了,能发一份pip list出来吗? ee@EE ~/movieweb_python-master/movieweb $ python manage.py runserver Unhandled exception in thread started by <function wrapper at 0x7f9d36958d70> Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/django/utils/autoreload.py", line 229, in wrapper fn(args, **kwargs) File "/usr/lib/python2.7/dist-packages/django/core/management/commands/runserver.py", line 107, in inner_run autoreload.raise_last_exception() File "/usr/lib/python2.7/dist-packages/django/utils/autoreload.py", line 252, in raise_last_exception six.reraise(_exception) File "/usr/lib/python2.7/dist-packages/django/utils/autoreload.py", line 229, in wrapper fn(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/django/init.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "/usr/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate app_config = AppConfig.create(entry) File "/usr/lib/python2.7/dist-packages/django/apps/config.py", line 86, in create module = import_module(entry) File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named rest_framework

EE1437 avatar Jun 15 '17 14:06 EE1437

这是没有模块: rest_framework,django-rest-swagger 需要 pip 安装: pip install djangorestframework pip install django-rest-swagger 我还用了 requests 模块,没有的话安装 pip install requests 基本上安装了这些,就能运行了。 你运行成功了,就通知一声。

hanyucd avatar Jun 16 '17 06:06 hanyucd