Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
963 views
in Technique[技术] by (71.8m points)

django - SyntaxError: Generator expression must be parenthezised / python manage.py migrate

I'm really new in programming and I wanted to follow the Djangogirls tutorial, but I'm stucked now. In the tutorial, I am here:

To create a database for our blog, let's run the following in the console: python manage.py migrate (we need to be in the djangogirls directory that contains the manage.py file). If that goes well, you should see something like this: ...

There is no option to fail in the tutorial but I have an error message:

(myvenv) C:UsersJulcsidjangogirls> python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangocoremanagement\__init__.py", 
line 364, in execute_from_command_line
utility.execute()
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangocoremanagement\__init__.py", 
line 338, in execute
django.setup()
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjango\__init__.py", 
line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangoapps
egistry.py", 
line 85, in populate
app_config = AppConfig.create(entry)
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangoappsconfig.py", 
line 94, in create
module = import_module(entry)
File "C:UsersJulcsiAppDataLocalProgramsPythonPython37libimportlib\__init__.py", 
line 127, 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 723, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_remove
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangocontribadmin\__init__.py", 
line 4, in <module>
from django.contrib.admin.filters import (
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangocontribadminfilters.py", 
line 10, in <module>
from django.contrib.admin.options import IncorrectLookupParameters
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangocontribadminoptions.py", 
line 12, in <module>
from django.contrib.admin import helpers, widgets
File "C:UsersJulcsidjangogirlsmyvenvlibsite-packagesdjangocontribadminwidgets.py", 
line 152
'%s=%s' % (k, v) for k, v in params.items(),
SyntaxError: Generator expression must be parenthesized

What am I doing wrong? What should I do?

I have Python 3.7.0b1

Thanks a lot in advance for the help :)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You’re not doing anything wrong; this is a problem between Django and Python 3.7. Django has a fix, but that fix hasn’t made it into a new version yet.

You can install the stable version of Python, Python 3.6, in the meantime.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...