gpt4 book ai didi

python - SyntaxError : Generator expression must be parenthezised/python manage. py 迁移

转载 作者:IT老高 更新时间:2023-10-28 21:41:22 27 4
gpt4 key购买 nike

我真的是编程新手,我想学习 Djangogirls 教程,但我现在卡住了。在教程中,我是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: ...

教程中没有失败的选项,但我有一条错误消息:

(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

我做错了什么?我该怎么办?

我有 Python 3.7.0b1

非常感谢您的帮助:)

最佳答案

你没有做错什么;这是 Django 和 Python 3.7 之间的问题。 Django has a fix ,但该修复尚未进入新版本。

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

关于python - SyntaxError : Generator expression must be parenthezised/python manage. py 迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48822571/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com