django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0....

Django2.2x, Python3.6在migrate時(shí)出現(xiàn)以下問題:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

網(wǎng)上流行注釋掉兩行,還是不行,另外總覺得去改設(shè)置文件也不是個好的習(xí)慣,繼續(xù)找路,發(fā)現(xiàn):

As per this pull request, The problem is not only the version number of mysqlclient. As per this ticket #30380, there may be many places in django where support for PyMySQL could be broken, and Django will not fix them(probably). Also, as per tickets #12500, #22391, Django does not support PyMySQL officially.

所以用mysqlclient取代pymysql:

  1. 刪除項(xiàng)目__init__.pypymysql的設(shè)置
  2. pip install mysqlclient
  3. 搞定!

進(jìn)一步可以參考這里:https://stackoverflow.com/questions/55472739/have-a-problem-using-django-2-2-with-pymysql

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

友情鏈接更多精彩內(nèi)容