使用wagtail start mysite返回语法错误

时间:2018-12-12 13:44:11

标签: wagtail

我正在使用pip,virtualenv和Python 3安装w。我正在使用Ubuntu。

要回溯一下: 我最初尝试安装时出现此错误:

unicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 47: ordinal not in range(128)

我通过将环境更改为使用Python 3来解决了这个问题。

这允许wagtail开始安装,但是在安装时返回了以下错误列表:

SyntaxError: invalid syntax

*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/feedgenerator.py'...
  File "/home/ubuntu/workspace/env/build/Django/django/utils/feedgenerator.py", line 82
    **kwargs,
     ^
SyntaxError: invalid syntax

*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/functional.py'...
  File "/home/ubuntu/workspace/env/build/Django/django/utils/functional.py", line 12
    return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs})
                                ^
SyntaxError: invalid syntax

*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/log.py'...
  File "/home/ubuntu/workspace/env/build/Django/django/utils/log.py", line 229
    )
    ^
SyntaxError: invalid syntax

*** Error compiling '/home/ubuntu/workspace/env/build/Django/django/utils/tree.py'...
l File "/home/ubuntu/workspace/env/build/Django/django/utils/tree.py", line 76
    return hash((self.__class__, self.connector, self.negated, *make_hashable(self.children)))
                                                                      ^
SyntaxError: can use starred expression only as assignment target

尽管存在语法错误,它还是给我成功的消息。

Successfully installed wagtail html5lib Django six Unidecode draftjs-exporter djangorestframework django-taggit pytz django-modelcluster Willow Pillow beautifulsoup4 requests django-treebeard webencodings urllib3 chardet idna certifi
Cleaning up...

尝试启动w后,我得到以下最终错误消息:

Traceback (most recent call last):
  File "/home/ubuntu/workspace/env/bin/wagtail", line 7, in <module>
    from wagtail.bin.wagtail import main
  File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/wagtail/bin/wagtail.py", line 10, in <module>
    from django.core.management import ManagementUtility
  File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 11, in <module>
    from django.conf import settings
  File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/conf/__init__.py", line 18, in <module>
    from django.utils.functional import LazyObject, empty
  File "/home/ubuntu/workspace/env/lib/python3.4/site-packages/django/utils/functional.py", line 12
    return _curried_func(*args, *moreargs, **{**kwargs, **morekwargs})

这最后一个错误是我无法解决的错误。我打开文件functional.py并查看了内容,它对我来说似乎正确。关于如何解决错误或根本原因的任何想法?

1 个答案:

答案 0 :(得分:3)

您正在运行Python 3.4,the current version of Django (2.1)不支持。您应该升级到Python 3.5或更高版本,或者通过运行pip install "Django>=2.0,<2.1"将Django降级到2.0.x。