Mac 安装mysqlclient包错

安装报错信息

在使用pip安装mysqlclient时,出现下面的报错

verhGY
verhGY

解决思路 安装mysql-connector-c:

brew install mysql-connector-c

安装完成后会有提示加入环境变量

HSDhyY
HSDhyY
执行命令

echo 'export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"' >> ~/.zshrc
export LDFLAGS="-L/opt/homebrew/opt/mysql-client/lib" >> ~/.zshrc
export CPPFLAGS="-I/opt/homebrew/opt/mysql-client/include" >> ~/.zshrc
source ~/.zshrc

再次进行安装

pip3 install mysqlclient
posted @ 2022-05-20 00:45  Lin-Grocery  阅读(164)  评论(0编辑  收藏  举报