Resolve modulenotfounderror: no module named ‘mysqldb’
System: Ubuntu 18.04
First, check the error reports:
There are two ways to Solve this error:
One is to use pymysql and add two lines of code, but because the code has been uploaded to the server and the modification is complex, the second method is adopted: install mysqlclient
, and execute the following command:
pip3 install mysqlclient
report errors:
After Google again, I found that libmysqlclient dev
needs to be installed first
apt-get install libmysqlclient-dev
PIP installation again, successful!
Similar Posts:
- [Solved] libmysqlclient.so.16: cannot open shared object file: No such file or directory Error
- When installing Python mysqlclient, “oserror: MySQL” appears_ “Config not found” error
- How to Solve Django Error: No module named ‘MySQLdb’
- [How to Solve] Library not loaded: libmysqlclient.18.dylib
- EnvironmentError: mysql_config not found
- Ubuntu 16.04 troubleshooting MySQL error [How to Solve]
- How to Solve QSqlDatabase Error: QMYSQL driver not loaded
- CentOS 7: How to Solve Mysqlclient Install Error
- ImportError: No module named ‘requests’
- Linux Error: _mysql.c:32:20: fatal error: Python.h: No such file or directory [Solved]