码迷,mamicode.com
首页 > 数据库 > 详细

raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)

时间:2019-05-24 18:46:45      阅读:515      评论:0      收藏:0      [点我收藏+]

标签:pac   nbsp   exce   conf   遇到的问题   ack   backend   encode   pytho   

转自:http://www.cnblogs.com/xiaobinglife/articles/10716605.html

 

一、Django数据同步过程中遇到的问题:

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

raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)

标签:pac   nbsp   exce   conf   遇到的问题   ack   backend   encode   pytho   

原文地址:https://www.cnblogs.com/olivertian/p/10919550.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!