安装mysqldb python接口时找不到mysql_config我正在尝试让Python脚本在我通过ssh连接到的Linux服务器上运行。脚本使用mysqldb。我有所需的所有其他组件,但当我试图通过setuptools安装mySQLdb时,如下所示:python setup.py install我得到以下与mysql_config命令。sh: mysql_config: command not foundTraceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config raise EnvironmentError("%s not found" % (mysql_config.path,))EnvironmentError: mysql_config not found还有其他人遇到过这个错误吗?如果是的话,您如何解决它/我如何才能成功地安装mysqldb呢?
3 回答
青春有我
TA贡献1784条经验 获得超8个赞
sudo apt-get install mysql-server
sudo apt-get install libmysqlclient-dev
sudo apt-get install libmariadbclient-dev
开满天机
TA贡献1786条经验 获得超12个赞
apt-get install libmysqlclient-dev python-dev
export PATH=$PATH:/usr/local/mysql/bin/
添加回答
举报
0/150
提交
取消