鹡鸰 2.0 安装错误

Posted

技术标签:

【中文标题】鹡鸰 2.0 安装错误【英文标题】:Wagtail 2.0 installation error 【发布时间】:2018-08-20 21:18:03 【问题描述】:

我正在我机器上的 virtualenvwrapper 中运行 wagtail。需求全部按需安装

Django>=2.0,<2.1
wagtail>=2.0,<2.1

我什至通过完全卸载 django 和 wagtail 重新开始了这个过程。重新安装 wagtail 后,我运行 wagtail start mysite,cd 进入我的目录并运行 python manage.py migrate。这是我看到的:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 332, in execute
    self.check()
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 364, in check
    include_deployment_checks=include_deployment_checks,
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 58, in _run_checks
    issues.extend(super()._run_checks(**kwargs))
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/management/base.py", line 351, in _run_checks
    return checks.run_checks(**kwargs)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/checks/registry.py", line 73, in run_checks
    new_errors = check(app_configs=app_configs)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/checks/urls.py", line 40, in check_url_namespaces_unique
    all_namespaces = _load_all_namespaces(resolver)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/core/checks/urls.py", line 57, in _load_all_namespaces
    url_patterns = getattr(resolver, 'url_patterns', [])
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/urls/resolvers.py", line 536, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/utils/functional.py", line 36, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/django/urls/resolvers.py", line 529, in urlconf_module
    return import_module(self.urlconf_name)
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/johnbriggs/Sites/wagtail/farts/farts/urls.py", line 5, in <module>
    from wagtail.admin import urls as wagtailadmin_urls
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/admin/urls/__init__.py", line 13, in <module>
    from wagtail.admin.api import urls as api_urls
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/admin/api/urls.py", line 6, in <module>
    from .endpoints import PagesAdminAPIEndpoint
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/admin/api/endpoints.py", line 3, in <module>
    from wagtail.api.v2.endpoints import PagesAPIEndpoint
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/wagtail/api/v2/endpoints.py", line 9, in <module>
    from rest_framework.renderers import BrowsableAPIRenderer, JSONRenderer
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/renderers.py", line 25, in <module>
    from rest_framework import VERSION, exceptions, serializers, status
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/exceptions.py", line 17, in <module>
    from rest_framework.utils.serializer_helpers import ReturnDict, ReturnList
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/utils/serializer_helpers.py", line 9, in <module>
    from rest_framework.compat import unicode_to_repr
  File "/Users/johnbriggs/.virtualenvs/wagtail/lib/python3.6/site-packages/rest_framework/compat.py", line 26, in <module>
    from django.core.urlresolvers import (  # Will be removed in Django 2.0
ModuleNotFoundError: No module named 'django.core.urlresolvers'

我没有添加任何自定义代码。这是从头开始的安装。是什么导致了这个错误?

【问题讨论】:

您是否尝试使用wagtail updatemodulepaths 命令:docs.wagtail.io/en/v2.0/releases/…? 修复了最初的错误并创造了更多哈哈...我会更新我的帖子。 查看***.com/questions/43139081/… 更新我的 urls.py 以使用较新的 Django 并没有走得太远。这是所有东西的全新安装,所以我真的很困惑为什么 Wagtail 会安装基于 django 1.11 而不是当前路径语法的 urlpatterns 绝对不是重复的。我查看了解决方案,搜索 django.core.urlresolvers 没有返回任何结果。 【参考方案1】:

原来 djangorestframework 是一个旧版本。这绝对不是建议的问题的重复,但我能够通过升级我的版本来解决它(正如@Alexy 所建议的那样)。如果其他人有类似的问题,我会留下这个。

【讨论】:

我在几次升级中都遇到了这个问题,而这正是我所做的——卸载并重新安装 DRF,它是黄金。 DRF 没有强制升级,因为 Wagtail 2.0 仍然可以在 Django 1.13 上运行。

以上是关于鹡鸰 2.0 安装错误的主要内容,如果未能解决你的问题,请参考以下文章

Microsoft.NET Framework 2.0安装错误,提示安装system.enterpriseservices.dll失败,系统错误25015

Rails 4.0.0 Ruby 2.0 therubyracer gem 安装错误

vmware vsphere client 5.0安装过程中提示:Microsoft Visual J#2.0 Second Edition安装程序返回错误代码"1

Postgres 错误 - 捆绑安装

scikits audiolab安装错误

如何解决 weasyprint 错误消息 gobject-2.0-0 错误 0x7e 消息?