在Fedora25上安装mysqlclient时出错

时间:2017-07-16 22:12:28

标签: mysql python-3.x pip fedora fedora-25

我正在尝试在我的虚拟环境中安装mysqlclient,该环境在python3.5.2上运行,但它总是抛出错误:

(venv) [kevran@localhost mysite]$ pip install mysqlclient   
  Collecting mysqlclient        
  Using cached mysqlclient-1.3.10.tar.gz
    Complete output from command python setup.py egg_info:
    /bin/sh: mysql_config: command not found   
    Traceback (most recent call last):   
      File "<string>", line 1, in <module>  
      File "/tmp/pip-build-m92fr1vk/mysqlclient/setup.py", line 17, in <module>
        metadata, options = get_config()   
      File "/tmp/pip-build-m92fr1vk/mysqlclient/setup_posix.py", line 44, in get_config     libs = mysql_config("libs_r")    
      File "/tmp/pip-build-m92fr1vk/mysqlclient/setup_posix.py", line 26, in mysql_config    
        raise EnvironmentError("%s not found" % (mysql_config.path,))    
    OSError: mysql_config not found

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-m92fr1vk/mysqlclient/

1 个答案:

答案 0 :(得分:1)

Yu需要在操作系统中安装mysql-devel包。

yum install mysql-devel

这样的事情。