报错:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
第一种方式:回退版本到2.1.7 第二种更改源代码
/home/ubuntu/.virtualenvs/py3env/lib/python3.6/site-packages/django/db/backends/mysql
这是我的文件路径 你们可以通过/lib/python3.6/site-packages/django/db/backends/mysql 寻找自己pip安装包路径进行对源码的修改
但是笔者还是建议各位降级,避免修改源码.降级到2.1.7就可以
#bash.py
注释
#if version < (1, 3, 3):
#raise ImproperlyConfigured(“mysqlclient 1.3.3 or newer is required; you have %s” % Database.version)
如果还有这种错误
AttributeError: ‘str’ object has no attribute ‘decode’
修改 #operations.py 查找快捷键:/decode
if query is not None:
query = query.decode(errors='replace')
return query
#改为
if query is not None:
query = query.encode(errors='replace')
return query