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

后端 未结 21 2657
广开言路
广开言路 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:09

    It seems mysql_config is missing on your system or the installer could not find it. Be sure mysql_config is really installed.

    For example on Debian/Ubuntu you must install the package:

    sudo apt-get install libmysqlclient-dev
    

    Maybe the mysql_config is not in your path, it will be the case when you compile by yourself the mysql suite.

    Update: For recent versions of debian/ubuntu (as of 2018) it is

    sudo apt install default-libmysqlclient-dev
    

提交回复
热议问题