'pip install MySQL-python' fails with 'IndexError'

前端 未结 4 1878
予麋鹿
予麋鹿 2020-12-03 03:41

I\'m on OSX El Capitan, using Python 2.7 (Anaconda). Launching the command pip install MySQL-python yields:

Collecting MySQL-python
  Using cach         


        
4条回答
  •  不知归路
    2020-12-03 04:17

    I met same error and solved with following instructions:

    1. brew uninstall mysql-connector-c
    2. brew install mysql
    3. invoke "mysql_config --libs" and confirm its output include correct library options: "-L/usr/local/Cellar/mysql/5.7.20/lib -lmysqlclient -lssl -lcrypto"
    4. export LDFLAGS=-L/usr/local/opt/openssl/lib && pip install mysqlclient

提交回复
热议问题