python括号生成,SyntaxError:生成器表达式必须加括号/ python manage.py migration

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:\Users\Julcsi\djangogirls> python manage.py migrate

Traceback (most recent call last):

File "manage.py", line 22, in

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 "", line 994, in _gcd_import

File "", line 971, in _find_and_load

File "", line 955, in _find_and_load_unlocked

File "", line 665, in _load_unlocked

File "", line 723, in exec_module

File "", line 219, in _call_with_frames_remove

File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\__init__.py",

line 4, in

from django.contrib.admin.filters import (

File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\filters.py",

line 10, in

from django.contrib.admin.options import IncorrectLookupParameters

File "C:\Users\Julcsi\djangogirls\myvenv\lib\site-packages\django\contrib\admin\options.py",

line 12, in

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?

I have Python 3.7.0b1

Thanks a lot in advance for the help :)

解决方案

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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值