Django Mysql驅動版本問題
- 2020 年 3 月 7 日
- 筆記
錯誤
... 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.
解決辦法
- 最直接,最牛X的解決辦法,臨時修改pymysql的版本
在你初始化mysql的地方 修改為所需要的版本,錯誤日誌中是需要1.3.13改為這個版本即可
import pymysql pymysql.version_info = (1, 3, 13, "final", 0) pymysql.install_as_MySQLdb()