pip install mysql-python fails with EnvironmentError: mysql_config not found

后端 未结 21 2349
广开言路
广开言路 2020-11-22 15:58

This is the error I get

(mysite)zjm1126@zjm1126-G41MT-S2:~/zjm_test/mysite$ pip install mysql-python
Downloading/unpacking mysql-python
  Do         


        
相关标签:
21条回答
  • 2020-11-22 16:24

    For Linux

    this works for me

    yum install python-devel mysql-devel
    
    0 讨论(0)
  • 2020-11-22 16:25

    Sequence to be followed.

    pip install mysqlclient
    sudo apt-get install python3-dev libmysqlclient-dev
    pip install configparser 
    sudo cp /usr/lib/python3.6/configparser.py /usr/lib/python3.6/ConfigParser.py 
    

    Then try to install the MYSQL-python again. That Worked for me

    0 讨论(0)
  • 2020-11-22 16:26

    For anyone that is using MariaDB instead of MySQL, the solution is to install the libmariadbclient-dev package and create a symbolic link to the config file with the correct name.

    For example this worked for me:

    ln -s /usr/bin/mariadb_config /usr/bin/mysql_config
    
    0 讨论(0)
提交回复
热议问题