I tried to start a Django project that had been working fine before, but after a long time, I encountered the following error:
version_info, _mysql.version_info, _mysql.__file__
NameError: name '_mysql' is not defined
If this happens, it means the project won't start.
This issue is caused by an update to the MySQL library outside of the Python project, which breaks the link from the mysqlclient within the project.
This is likely due to running a command like brew install mysql-client.
You can resolve this issue by reinstalling mysqlclient.
pip install --force-reinstall mysqlclient
Comments