报错: raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Dat
Posted 与其感慨路难行 不如即刻出发
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了报错: raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Dat相关的知识,希望对你有一定的参考价值。
Django2.0同步Mysql数据库时出现的问题
执行 python manage.py makemigrations 报错
# 报错位置 File "G:pythonlibsite-packagesdjangodbackendsmysqlase.py", line 36, in <module> # 报错问题 raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.‘ % Database.__version__) django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
解决方案
第一步:
点击报错位置找到这两行 注释掉
version = Database.version_info # if version < (1, 3, 13): # raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.‘ % Database.__version__)
第二步
再次执行python manage.py makemigrations 报错
# 报错路径
File "G:pythonlibsite-packagesdjangodbackendsmysqloperations.py", line 146, in last_executed_query query = query.decode(errors=‘replace‘)
# 报错问题 AttributeError: ‘str‘ object has no attribute ‘decode‘
修改 :将代码里面query.decode改成:query.encode
if query is not None: query = query.encode(errors=‘replace‘) # 修改后的 return query
以上是关于报错: raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Dat的主要内容,如果未能解决你的问题,请参考以下文章
jupyter 报错 raise RuntimeError(‘This event loop is already running‘)
报错: raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Dat
jpype测试报错,找不到类raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
报错 raise MigrationSchemaMissing("Unable to create the django_migrations table (%s)" % exc)
python pip安装 mysqlclient 报错 raise EnvironmentError("%s not found" % (_mysql_config_path,))
python3.7.3使用web.py报错解决办法 and RuntimeError: generator raised StopIteration