python错误汇总3:安装MySQLdb时:EnvironmentError: mysql_config not found

文章来源:http://wangjunle23.blog.163.com/blog/static/117838171201331463342722/


安装mysqldb时出现以下错误:

sh: mysql_config: command not found Traceback (most recent call last): File "setup.py", line 15, in <module> metadata, options = get_config() File "/home/software/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config libs = mysql_config("libs_r") File "/home/software/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


find / -name mysql_config 

出现:

/usr/local/mysql-5.0.67/bin/mysql_config


修改setup_posix.py文件:
mysql_config.path = " /usr/local/mysql-5.0.67/bin/mysql_config "

修改完成后保存,再执行
python setup.py build
python setup.py install
python setup.py bdist_rpm

安装完成

你可能感兴趣的:(python错误汇总3:安装MySQLdb时:EnvironmentError: mysql_config not found)