python mac安装MySQLdb 模块 遇到的坑

1.首先需要在mac安装好mysql

2.遇到错误

    error: command 'cc' failed with exit status 1

_mysql.c:44:10: fatal error: 'my_config.h' file not found
解决方案

brew install mysql-connector-c   重装一遍这个

3.遇到错误  string index out of range

vim /usr/local/bin/mysql_config

修改114行 

114 libs="$libs -l "

改为  libs="$libs -lmysqlclient -lssl -lcrypto"

在安装MYSQL-PYTHON 成功  

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章