ImportError:即使安装了Django,也没有名为django的模块

时间:2018-08-07 14:34:57

标签: python django

当我写pip list时,在那里可以看到django。当我在python shell中编写import django时,没有错误。但是当我写python manage.py runserver时,出现以下错误:

Unhandled exception in thread started by <function wrapper at 0x105838b18>
Traceback (most recent call last):
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/utils/autoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/utils/autoreload.py", line 250, in raise_last_exception
    six.reraise(*_exception)
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/utils/autoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/manitgupta/virtualenvs/testify/lib/python2.7/site-packages/django/apps/config.py", line 127, in create
    import_module(entry)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named django

0 个答案:

没有答案