SyntaxError:生成器表达式必须括在括号中/python manage.py migration [英] SyntaxError: Generator expression must be parenthezised / python manage.py migrate

查看:250
本文介绍了SyntaxError:生成器表达式必须括在括号中/python manage.py migration的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的是编程新手,我想按照Djangogirls教程学习,但是现在我陷入了困境. 在本教程中,我此处:

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:

要为我们的博客创建数据库,让我们在控制台中运行以下命令:python manage.py migration(我们必须位于包含manage.py文件的djangogirls目录中).如果一切顺利,您应该会看到类似以下内容的内容:...

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:\Users\Julcsi\djangogirls> python manage.py migrate
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\core\management\__init__.py", 
line 364, in execute_from_command_line
utility.execute()
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\core\management\__init__.py", 
line 338, in execute
django.setup()
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\__init__.py", 
line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\apps\registry.py", 
line 85, in populate
app_config = AppConfig.create(entry)
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\apps\config.py", 
line 94, in create
module = import_module(entry)
File "C:\Users\Julcsi\AppData\Local\Programs\Python\Python37\lib\importlib\__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:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\__init__.py", 
line 4, in <module>
from django.contrib.admin.filters import (
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\filters.py", 
line 10, in <module>
from django.contrib.admin.options import IncorrectLookupParameters
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\options.py", 
line 12, in <module>
from django.contrib.admin import helpers, widgets
File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\widgets.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?

我有Python 3.7.0b1

I have Python 3.7.0b1

非常感谢您的帮助:)

推荐答案

您没有做错任何事情;这是Django和Python 3.7之间的问题. Django有一个修补程序,但该修补程序尚未将它变成新版本.

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.

同时,您可以安装Python的稳定版本Python 3.6.

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

这篇关于SyntaxError:生成器表达式必须括在括号中/python manage.py migration的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆