Django踩坑之django.core.exceptions.ImproperlyConfigured mysqlclient 1.3.13 or newer is required; you have 0.9.3.
安装Django3后不想折腾mysqlclient那堆库文件,直接装了pymysql替代mysqlclient,报错:django.core.exceptions.ImproperlyConfigured mysqlclient 1.3.13 or newer is required; you have 0.9.3.。实际上pymysql版本号是 0.9.3,却明目张胆篡改version_info欺骗Django。这样一来就简单了,patch一下这个属性就行了嘛,# 在与 settings.py 同级目录下的 init.py 中引入模块和进行配置, 修改__init__.py,多插入一行代码:
import pymysql
pymysql.version_info = (1, 3, 13, "final", 0)
pymysql.install_as_MySQLdb()
setting.py中设置:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
'NAME':'mysql',
'HOST':'localhost',
'USER':'root',
'PASSWORD':'',
'HOST':'127.0.0.1'
}
}
参考博客:https://yuntianti.com/posts/fix-django3-mysqlclient-import-error/
Django踩坑之django.core.exceptions.ImproperlyConfigured mysqlclient 1.3.13 or newer is required; you have 0.9.3.的更多相关文章
- Django2.2报错 django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
准备将 Django 连接到 MySQL,在命令行输入命令 python manage.py makemigrations 后报错: django.core.exceptions.Improperly ...
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2的最佳处理方法,亲测可用
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.2 ...
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.解决办法
"E:\API_Manager_PlatForm\venv\lib\site-packages\django\db\backends\mysql\base.py"在这个路径里件把b ...
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
异常汇总:https://www.cnblogs.com/dotnetcrazy/p/9192089.html 这个是Django对MySQLdb版本的限制,我们使用的是PyMySQL,所以不用管它 ...
- Django生成脚本迁移文件时,报错django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
一.本人环境:django:3.0.2, python:3.8.1, pymysql:0.9.3 二.解决步骤: 1.django目录下找到 base.py文件: 2.在base.py文件中注释以下 ...
- Django2.2连接mysql数据库出现django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None问题
在使用Django2.2开发的时候,想要使用mysql数据库,在settings.py文件中更改命令: DATABASES = { 'default': { 'ENGINE': 'django.db. ...
- django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11
搭建Django2.0+Python3+MySQL5时同步数据库时报错:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 o ...
- exceptions: django2.2/ mysql ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
在centos部署python应用后访问页面,显示如下异常信息 报错环境 python=3.6,django=2.2……django.core.exceptions.ImproperlyConfigu ...
- django2.2/mysql ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
报错环境 python=3.6.5,django=2.2,PyMySQL=0.9.3 …… django.core.exceptions.ImproperlyConfigured: mysqlcl ...
- Django项目配置数据库时,已安装mysqlclient,却提示 Did you install mysqlclient错误,后右报错ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3
错误信息如下: 解决方案是: 找到自己的项目文件夹下的__init__.py 添加如下代码 解决这个问题后,右报错django2.2/mysql ImproperlyConfigured: mysq ...
随机推荐
- 飞牛 fnos 使用docker部署NapCat-QQ对接autman教程
NapCatQQ介绍 无需图形环境,在Linux上表现出色,与现有Hook框架有本质区别,性能与内存占用优于基于Hook的框架. 配置简单,支持浏览器远程配置. NTQQ功能适配快速,持续跟进QQ最新 ...
- Typecho如何添加微博表情包
自从添加了蛆音娘表情包就想着去爬点其他地方的表情包- 使用教程跟蛆音娘一样 :点我查看 #表情包代码: "微博":{ "type": "usr&quo ...
- MySQL Q&A - [02] windows上MySQL的安装路径变更之后无法启动MySQL服务
参考:https://blog.csdn.net/weixin_45271005/article/details/130091868 Step1:首先,变更之前,需要保证MySQL服务是停止运行的 S ...
- Ansible - [01] 入门&安装部署
自动化运维工具,可以批量远程其他主机并进行管理操作 一.什么是 Ansible Ansible首次发布于2012年,作者:Michael DeHaan,同时也是Cobbler的作者,Ansible于2 ...
- c# virtual 关键字 虚方法
1.简单的说,虚方法就是可以被子类重写的方法,如果子类重写了虚方法,那么运行时将使用重写后的逻辑,如果没有重写,则使用父类中虚方法的逻辑 class Program { static void Mai ...
- factor
factor easy_factor1 task.py from Crypto.Util.number import * from Crypto.Util.Padding import * from ...
- 《learn to count everything》论文阅读、实验记录
<learn to count everything>论文阅读 模式识别这门课最后选了这篇论文汇报,记录一下吧. 参考资料: [论文解读]CVPR2021 | FamNet:密集场景计数统 ...
- 带大家做了个 AI 项目,没想到这么简单!
大家好,我是程序员鱼皮,现在已经是全民 AI 时代了,咱们程序员更要想办法榨干 AI,把 AI 利用起来.前几天我一时兴起,直播用 2 多个小时的时间,从需求分析开始,带大家做了一个 AI 海龟汤游戏 ...
- rust学习笔记(1)
参考 rust圣经 参考 通过例子学习rust cargo 是rust的包管理器+编译工具 创建新项目 使用下述指令创建一个新的项目 cargo new rust_learn 执行 使用 cargo ...
- k8s dial tcp 127.0.0.1:6443: connect: connection refused排查流程及解决思路
前言 k8s 集群中,使用 kubelet 报错,如下: The connection to the server 127.0.0.1:6443 was refused - did you speci ...