赞
踩
在运行python manage.py inspectdb时,报错django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2
查了不少网上文章,最后以这个方法搞定。关键在要找到下面这个文件。原来文章中的路径不一样,所以你可以试下有搜索。。。注意,原文稿中要修改两个位置,我只修改下面一个,另一个没找到,但是运行可以。
解决方案:
1、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.
解决办法:
C:\Python37\Lib\site-packages\django\db\backends\mysql(python安装目录)打开base.py,注释掉以下内容:
if version < (1, 3, 13): raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.’ % Database.version)
2、(这个没找到修改位置)File “C:\Python37\lib\site-packages\django\db\backends\mysql\operations.py”, line 146, in last_executed_query
query = query.decode(errors=‘replace’)
AttributeError: ‘str’ object has no attribute ‘decode’
解决办法:
打开此文件把146行的decode修改为encode
C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Lib\site-packages\django\db\backends\mysql\base.py
原文网址:https://blog.csdn.net/weixin_45476498/article/details/100098297
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。