我正在使用 Ubuntu 20.04。在 Ubuntu 18.04 中一切正常,但在我将操作系统从 18.04 升级到 20.04 后,它现在在 django 中显示此错误:
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module.
Did you install mysqlclient?
之后我尝试了这个命令:
pip install mysqlclient
结果pip install mysqlclient
:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: mysqlclient in ./.local/lib/python3.7/site-packages (1.4.6)
我也试过:
import pymysql
pymysql.install_as_MySQLdb()
它给出了版本错误。