T.J.
T.J.

Reputation: 415

Using wagtail start mysite returns syntax error

I am using pip, virtualenv and Python 3 to install wagtail. I am working on Ubuntu.

To backtrack a bit: I was trying to install initially and got this error:

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

I fixed this by changing my env to use Python 3.

This allows wagtail to start installing, but returned this list of errors while installing:

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

It gave me a success message despite the syntax errors.

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...

After trying to start wagtail I have this final error message:

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})

This final error is the one I have not been able to solve. I opened the file functional.py and reviewed the contents and it looks correct to me. Any ideas on how to fix the error or what the root cause could be?

Upvotes: 1

Views: 203

Answers (1)

gasman
gasman

Reputation: 25317

You are running Python 3.4, which is not supported by the current version of Django (2.1). You should either upgrade to Python 3.5 or above, or downgrade Django to 2.0.x by running pip install "Django>=2.0,<2.1".

Upvotes: 3

Related Questions