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

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

    This solved my issue:

         brew install mysql@5.7
         brew link --force mysql@5.7
    
    0 讨论(0)
  • 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
    
    0 讨论(0)
  • 2020-12-03 04:10

    I got the same error while installing pip install MySql-python.

    Then, I had installed libmysqlclient-dev using the command:

    sudo apt install libmysqlclient-dev

    After installing it, I tried again and pip install MySql-python and it worked for me.

    0 讨论(0)
  • 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
    0 讨论(0)
提交回复
热议问题