返回顶部

收藏

python-mysql安装报错mysql_config not found

更多

pip install python-mysql时报错:

    sh: 1: mysql_config: not found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-uveUwg/MySQL-python/setup.py", line 17, in <module>
        metadata, options = get_config()
      File "setup_posix.py", line 43, in get_config
        libs = mysql_config("libs_r")
      File "setup_posix.py", line 25, in mysql_config
        raise EnvironmentError("%s not found" % (mysql_config.path,))
    EnvironmentError: mysql_config not found

解决问题的方法是:

(1)ubuntu下

执行sudo apt-get install libmysqld-dev

(2)fedora下

执行 sudo yum install python-devel sudo yum install mysql-devel

标签:python,mysql

收藏

0人收藏

支持

0

反对

0

发表评论