mysql python - KerwinKoo/KerwinKoo.github.io GitHub Wiki

python 安装 mysql-python

如果不从新立德中下的话,需要去官网下载, 然后:python setup.py install

问题整理

mysql-python安装时错误:

EnvironmentError: mysql_config not found

解决方案:

apt-get install libmysqlclient-dev
找到mysql_config文件的路径

sudo updatedb
locate mysql_config

mysql_config的位置为:/usr/bin/mysql_config

在mysql-python源码包下找到:setup_posix.py 文件,
然后找到文件中的 mysql_config.path 
将其值改为:/usr/bin/mysql_config,
然后 sudo python setup.py install ,就ok了

安装python模块时出现error

error信息:

 Setup script exited with error: command 'gcc' failed with exit status 1

解决方案:

sudo apt-get install python-dev

安装mysql:

sudo apt-get install mysql-server 
Sudo apt-get install  mysql-client
⚠️ **GitHub.com Fallback** ⚠️