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

前端 未结 4 1876
予麋鹿
予麋鹿 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:07

    Copy from this blog.

    By finding out the information that mysql-connector-cmight come to the conclusion that the configuration by brew installation may be incorrect , open the /usr/local/bin/mysql_config script to modify some of the contents of it:

    #Create options
    Libs = "-L$pkglibdir "
    Libs = "$libs -l"
    

    change into:

    #Create options
    Libs = "-L$pkglibdir"
    Libs = "$libs -lmysqlclient -lssl -lcrypto"
    

    Save
    Then re-install mysql-python:

    pip install mysql-python
    

提交回复
热议问题