• MySQLdb/mysql-python安装时EnvironmentError: mysql_config not found


    代码:root@vpser:~# cd MySQL-python-1.2.3
    root@vpser:~/MySQL-python-1.2.3# python setup.py install 
    sh: mysql_config: not found
    Traceback (most recent call last):
      File "setup.py", line 15, in <module>
        metadata, options = get_config()
      File "/root/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "/root/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的位置,使用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
    python setup.py bdist_rpm

    安装完成

    备注:http://sourceforge.net/projects/mysql-python/

  • 相关阅读:
    Event bubbling
    input/change event practice
    Form event
    Event_Object
    DOM_this keyword
    Random color generator exercise
    DOM_events_addEventListener
    Spring值SpEL
    Spring之使用外部属性文件
    Spring之Bean的作用域
  • 原文地址:https://www.cnblogs.com/chuanheng/p/3681208.html
Copyright © 2020-2023  润新知