django+mysql(1)
2024-09-05 04:04:06
报错误: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
最新文章
- 搭建ssm的领悟
- jQuery效果之隐藏与显示、淡入淡出、滑动、回调
- Redis 笔记与总结6 Redis 高级应用之 事务处理、持久化操作、pub_sub、虚拟内存
- ubuntu 乱码 改为英文
- Jquery中bind和live的区别
- 怎么利用ultraISO对一个文件夹制作ISO镜像
- font-face 使用
- 使用SQLServer Audit来监控触发器的启用、禁用情况
- MySQL慢查询日志分析
- BZOJ_4448_[Scoi2015]情报传递_主席树
- 纯手写springIOC
- linq基本操作
- iOS 应用程序目录结构
- gzip: stdin:unexpected end of file
- elipse安装php
- BZOJ2761:[JLOI2011]不重复数字(map)
- 让Delphi XE5跟其他版本的Delphi共存
- HDU 2647 Reward【反向拓扑排序】
- 【转】log4js在PM2的cluster模式下大坑
- 更新Svn客户端后,右键菜单中没有TortoiseSVN
热门文章
- Python全国二级等级考试(2019)
- Linux通过AIO进行异步读文件
- mongodb 添加用户报错TypeError:db.addUser is not a function (mongodb3.4.1)
- 目标检测-Cascade-RCNN
- Cache数据库新增用户并分配权限(Cach&#233;)
- postman--接口网站测试
- mysql/mariadb数据库在插入表数据时,ID竟然成奇数增加了?看完下面内容就知道怎么处理了。
- 使用tensorflow训练SSD(一):相关环境的配置
- python第二部分
- 洛谷 题解 P4158 【[SCOI2009]粉刷匠】