1. 程式人生 > >MacOS 安裝MysqlDB 問題解決方案( 解決 IndexError: string index out of range)

MacOS 安裝MysqlDB 問題解決方案( 解決 IndexError: string index out of range)

pip install MySQL-python時報錯如下:

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/wk/541xl0m91gj7562sn0ddpjg9k8mh7p/T/pip-install-FF6W2Y/MySQL-python/

解決方案:brew install mysql
brew unlink mysql
brew install mysql-connector-c
sed -i -e 's/libs="$libs -l "/libs="$libs -lmysqlclient -lssl -lcrypto"/g' /usr/local/bin/mysql_config
pip install MySQL-python
brew unlink mysql-connector-c
brew link --overwrite mysql
尊重原創 原文地址:https://blog.csdn.net/eri_feng/article/details/81224106