mv download MySQL-python-1.2.4b4.tar.gz
tar -zxvf MySQL-python-1.2.4b4.tar.gz
cd MySQL-python-1.2.4b4
python setup.py build
报错:mysql_config not found 解决: 1)使用whereis mysql命令找到mysql安装目录,假设mysql安装在/usr/local/mysql 2) 回到MySQLdb源码目录, vi setup_posix.py 或 vimsetup_posix.py打开配置文件,找到mysql_config.path一行,把路径改为mysql安装路径下bin目录,即mysql_config.path ="/usr/local/mysql/bin/mysql_config"。 如果MySQL安装在系统默认路径下,mysql_config脚本文件位于"/usr/bin/mysql_config"。(如果没有mysql_config,则需要安装mysql-dev包) 报错:error: command ‘gcc‘ failed with exit status 1 解决: yum install gcc python-devel
python setup.py install
时间: 2024-10-28 21:24:50