且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

加载 MySQLdb 模块和“pip install MySQLdb"时出错

更新时间:2021-08-20 22:26:51

显然安装 pip install MySQL-python 是要走的路.问题在于 mysql_config 的位置.看看这里,这可能会对您有所帮助,具体取决于您的操作系统:安装mysqldb python接口时找不到mysql_config

Clearly installing pip install MySQL-python is the way to go. The problem is with the location of mysql_config. Look around here, this might help you depending on your OS: mysql_config not found when installing mysqldb python interface

如果安装脚本失败,Command "python setup.py egg_info" failed with error code 1 in {...},使用

In case the install script fails with Command "python setup.py egg_info" failed with error code 1 in {...}, installing libmysqlclient-dev with

sudo apt install libmysqlclient-dev

应该解决这个问题.感谢@thirupathi-thangavel.

should fix the issue. Thanks to @thirupathi-thangavel.