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

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

    If you are on MAC Install this globally

    brew install mysql
    

    then export path like this

    export PATH=$PATH:/usr/local/mysql/bin
    

    Than globally or in your venv whatever you like

    pip install MySQL-Python
    

    Note: globally for python3 as Mac can have both python2 & 3

    pip3 install MySQL-Python
    

提交回复
热议问题