django1.11和python版本不兼容问题

django 1.11版本与python不兼容,启动django时候报错 ,2.0版本以后的Django修复了这个问题

解决办法:1 找到对应python环境下的widgets.py 删除逗号    python/Lib/site-packages/django/contrib/admin/widgets.py 151行

2 升级Django版本 pip install -U Django

Exception ignored in thread started by: <function check_errors.<locals>.wrapper at 0x0000025AADBD8D30>
Traceback (most recent call last):
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangoutilsautoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangocoremanagementcommands
unserver.py", line 117, in inner_run
    autoreload.raise_last_exception()
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangoutilsautoreload.py", line 250, in raise_last_exception
    six.reraise(*_exception)
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangoutilssix.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangoutilsautoreload.py", line 227, in wrapper
    fn(*args, **kwargs)
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjango\__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangoapps
egistry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangoappsconfig.py", line 94, in create
    module = import_module(entry)
  File "D:Python38libimportlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangocontribadmin\__init__.py", line 4, in <module>
    from django.contrib.admin.filters import (
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangocontribadminfilters.py", line 10, in <module>
    from django.contrib.admin.options import IncorrectLookupParameters
  File "D:softwarepy_workon_homepy38workstudentManagementSyslibsite-packagesdjangocontribadminoptions.py", line 12, in <module>
    from django.contrib.admin import helpers, widgets
SyntaxError: Generator expression must be parenthesized (widgets.py, line 151)
原文地址:https://www.cnblogs.com/wsnan/p/15510790.html