django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3问题解决

测试环境:

Python:3.8
PyMySQL:0.9.3

 

在makemigrations后报错

manage.py@BookSys > makemigrations
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3

可以通过升级的mysql客户端版本至更高解决,但是很麻烦

下面介绍一种简单的修改办法

 

找到python安装目录下的base.py文件,目录参考:/项目名/venv/lib/python3.8/site-packages/django/db/backends/mysql/base.py

也可以直接在pycharm里面打开,就在左侧的venv下面

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3问题解决

 

 

找到上面文件中的这两行代码,并注释掉,就可以正常makemigrations了

if version < (1, 3, 13):
raise ImproperlyConfigured(mysqlclient 1.3.13 or newer is required; you have %s. % Database.__version__)

 

然后再执行makemigrate就不会报错了

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3问题解决

 

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3问题解决

上一篇:【TSQL】空格的比较


下一篇:从SQL Server 2005 中 导入 导出 excel 表格