VPS侦探论坛

 找回密码
 注册
查看: 15744|回复: 0

[Oracle] MySQLdb/mysql-python安装时EnvironmentError: mysql_config not found

[复制链接]
发表于 2011-5-5 14:14:18 | 显示全部楼层 |阅读模式

  1. root@vpser:~# cd MySQL-python-1.2.3
  2. root@vpser:~/MySQL-python-1.2.3# python setup.py install
  3. sh: mysql_config: not found
  4. Traceback (most recent call last):
  5.   File "setup.py", line 15, in <module>
  6.     metadata, options = get_config()
  7.   File "/root/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
  8.     libs = mysql_config("libs_r")
  9.   File "/root/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
  10.     raise EnvironmentError("%s not found" % (mysql_config.path,))
  11. EnvironmentError: mysql_config not found
复制代码

首先查找mysql_config的位置,使用find / -name mysql_config ,比如我的在/usr/local/mysql/bin/mysql_config


修改setup_posix.py文件,在26行:
mysql_config.path = "mysql_config" 修改为:
mysql_config.path = "/usr/local/mysql/bin/mysql_config"

修改完成后保存,再执行


python setup.py build
python setup.py install


安装完成
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-11-25 02:08 , Processed in 0.032767 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表