" ImportError:没有名为' tastypie'"在运行" django-admin migrate"

时间:2015-05-23 01:09:28

标签: python django django-admin

我在尝试发布" django-admin migrate"时收到以下错误堆栈命令:

Traceback (most recent call last):
File "/usr/bin/django-admin", line 21, in <module>
    management.execute_from_command_line()
File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
  utility.execute()
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 354, in execute
    django.setup()
File "/usr/lib/python3/dist-packages/django/__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
File "/usr/lib/python3/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
File "/usr/lib/python3/dist-packages/django/apps/config.py", line 87, in create
    module = import_module(entry)
File "/usr/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import     
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load  
File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named 'tastypie'

列出运行pip listdjango-tastypie (0.12.1)时。 谁知道为什么django找不到这个模块?

提前致谢!

1 个答案:

答案 0 :(得分:1)

在项目的tastypie文件中将INSTALLED_APPS添加到settings.py

INSTALLED_APPS = (   
    ...   
    ...
    'tastypie',   
)