报错误:mysqlclient 1.3.13 or newer is required; you have 0.9.3

第一种:
django降到2.1.4版本就OK了

第二种(仍使用django 2.2版本):

找到python环境下的/site-packages/django/db/backends/mysql/base.py

# 找到base.py文件,注释掉 base.py 中如下部分(35/36行) 
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文件(46行,版本不同行数不同哈~自个儿find一下),将decode改为encode #linux vim 查找快捷键:?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

最新文章

  1. 搭建ssm的领悟
  2. jQuery效果之隐藏与显示、淡入淡出、滑动、回调
  3. Redis 笔记与总结6 Redis 高级应用之 事务处理、持久化操作、pub_sub、虚拟内存
  4. ubuntu 乱码 改为英文
  5. Jquery中bind和live的区别
  6. 怎么利用ultraISO对一个文件夹制作ISO镜像
  7. font-face 使用
  8. 使用SQLServer Audit来监控触发器的启用、禁用情况
  9. MySQL慢查询日志分析
  10. BZOJ_4448_[Scoi2015]情报传递_主席树
  11. 纯手写springIOC
  12. linq基本操作
  13. iOS 应用程序目录结构
  14. gzip: stdin:unexpected end of file
  15. elipse安装php
  16. BZOJ2761:[JLOI2011]不重复数字(map)
  17. 让Delphi XE5跟其他版本的Delphi共存
  18. HDU 2647 Reward【反向拓扑排序】
  19. 【转】log4js在PM2的cluster模式下大坑
  20. 更新Svn客户端后,右键菜单中没有TortoiseSVN

热门文章

  1. Python全国二级等级考试(2019)
  2. Linux通过AIO进行异步读文件
  3. mongodb 添加用户报错TypeError:db.addUser is not a function (mongodb3.4.1)
  4. 目标检测-Cascade-RCNN
  5. Cache数据库新增用户并分配权限(Cach&#233;)
  6. postman--接口网站测试
  7. mysql/mariadb数据库在插入表数据时,ID竟然成奇数增加了?看完下面内容就知道怎么处理了。
  8. 使用tensorflow训练SSD(一):相关环境的配置
  9. python第二部分
  10. 洛谷 题解 P4158 【[SCOI2009]粉刷匠】