如何在 Mac OS X 下安装 python-mysql

2025-04-07 18:55:03
推荐回答(1个)
回答1:

解决方法:

先把之前装的卸载干净:
pip uninstall mysql-python
brew uninstall mysql-connector-c
现在设置下mysql_config路径:
首先修改系统配置文件vim ~/.bash_profile或者有些人是 ~/.profile,export PATH=$PATH:/Applications/MAMP/Library/bin
这里/Applications/MAMP/Library/bin是MAMP的mysql配置文件路径
安装
brew install mysql-connector-c
pip install mysql-python

我是这么搞定的