标签:
首先,请安装mysql sudo apt-get install mysql 期间,需要设置root 密码 下载mysql-python: http://sourceforge.net/projects/mysql-python/?source=dlp 解压: tar zxvf MySQL-python-1.2.4b4.tar.gz 进到该目录: cd MySQL-python-1.2.4b4 执行安装脚本: python setup.py build python setup.py install 这个时候就会出现问题了: sh: mysql_config: command not found Traceback (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 根据提示可知,mysql_config 找不到!!!! 网友解决思路如下: vi site.cfg 把 mysql_config = /usr/local/mysql/bin/mysql_config 这一行前的#去掉,并且把mysql_config的路径设置正确。 python setup.py build sudo python setup.py install 但是我的系统中根本就找不到mysql_config 文件,原因是该文件是通过安装另外一个包才能安装到系统中的 另一位牛人回复到: mysql-config is in a different package, which can be installed from (again, assuming debian / ubuntu): sudo apt-get install libmysqlclient-dev 好了,终于找到原因了,于是安装包libmysqlclient-dev 然后查看mysql_config 文件的安装目录是/usr/bin/mysql_config
标签:
原文地址:http://www.cnblogs.com/fengjian2016/p/5269991.html