Linux云服务ModuleNotFoundError: No module named 'MySQLdb'
程序员文章站
2022-07-14 21:37:10
...
问题描述:
安装MySQLdb,并且做了软连接
sudo yum install MySQL-python
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
出错信息:
import MySQLdb
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'MySQLdb'
>>>
解决方法:
pip install mysqlclient