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

Posted BertSun

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3相关的知识,希望对你有一定的参考价值。

Django报错 | “django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.问题解决方案

1 问题分析

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或更高版本; 您有0.9.3。
言下之意就是您的mysqlclient版本较低,需要更新

2 解决(linux系统下)

2.1 找到相关文件的路径

笔者本机地址为(您可以参考这来寻找):

"/home/bert/.virtualenvs/nami_py3/lib/python3.6/site-packages/django/db/backends/mysql/base.py",

2.2 修改base.py相关内容

即如下进行注释:

# version = Database.version_info
# if version < (1, 3, 13):
#    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的主要内容,如果未能解决你的问题,请参考以下文章