django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
2020-03-06 21:10
1251 查看
ubuntu环境:使用python3.6+django2.2+pymysql时遇到这个错误
原因:
django2.2内部的一个版本限制,和pymysql版本不匹配
方案:
1、找到python的安装目录(虚拟环境就在.virtualenvs里面找)
我的python安装目录: /home/python/.virtualenvs/study/lib/python3.6/site-packages/django/db/backends/mysql 里面有base.py和operations.py文件
2、打开base.py文件,找到下面两行代码注释掉:
if version < (1, 3, 13): raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)
3、打开operations.py文件,把146行的decode修改为encode
原代码: if query is not None: query = query.decode(errors='replace') 修改后: if query is not None: query = query.encode(errors='replace')
-----问题解决
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- 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
- 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.
- 关于Django出现2.X出现mysqlclient 1.3.13 or newer is required; you have 0.9.3.,注释掉if version还是不行
- win10 下 django2.2生成mysql数据迁移文件出错(mysqlclient 1.3.13 or newer is required; you have 0.9.3)解决方法
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11
- Django中使用mysqlclent服务报错:mysqlclient 1.3.13 or newer is required; you have 0.9.3.
- ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3. 解决办法
- Django将数据库切换为Mysql及mysqlclient 1.3.13 or newer is required; you have 0.9.2报错解决方案
- Django连接mysql django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required;
- macOS使用django安装mysqlclient遇到的问题(mysqlclient 1.3.3 or newer is required)
- 解决 Django 的 if version (1, 3, 3): raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is requi
- Hue 安装问题django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: libmysqlclient.so
- Caused by: com.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required
- om.mysql.cj.exceptions.UnableToConnectException: CLIENT_PLUGIN_AUTH is required报错
- Can't find msguniq. Make sure you have GNU gettext tools 0.15 or newer installed.
- Make sure you have Java JDK or JRE installed and the required ports are free
- The 'InnoDB' feature is disabled; you need MySQL built with 'InnoDB' to have it working
- 解决#1289 - The \'InnoDB\' feature is disabled; you need MySQL built with \'InnoDB\' to have it working的问题