在运行manage.py ... import时遇到错误无法导入名称后端

时间:2018-09-27 11:55:33

标签: python django

Traceback (most recent call last):
 File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
 File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
    utility.execute()
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute
    django.setup()
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/__init__.py",                                                                                         line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/registry                                                                                        .py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/home/devbase/env/local/lib/python2.7/site-packages/django/apps/config.p                                                                                        y", line 94, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/devbase/env/local/lib/python2.7/site-packages/djorm_pgtrgm/__init_                                                                                        _.py", line 1, in <module>
    from django.db import backend
ImportError: cannot import name backend

1 个答案:

答案 0 :(得分:2)

您似乎正在使用djorm_pgtrgm。它已经两年没有更新了,所以您不能指望它可以与最新版本的Django一起使用。

This merged pull request表示导入错误已在GitHub存储库中修复,但此后没有发布任何版本。您可以尝试从源代码安装,但是您应该考虑是否要在项目中使用未维护的软件包。