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

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

    For centos users:

    yum install -y mysql-devel python-devel python-setuptools

    then

    pip install MySQL-python


    If this solution doesn't work, and print gcc compile error like:
    _mysql.c:29:20: error: Python.h: No such file or directory

    You need to specify the path of Python.h, like this:
    pip install --global-option=build_ext --global-option="-I/usr/include/python2.6" MySQL-python

提交回复
热议问题