虚拟环境下安装mysqlclient
先进入虚拟环境
workon mxonline
pip install mysqlclient 会出现:
mysql_config not found
或者
ld:library not found for -lssl
解决办法:
1. brew install mysql
2. sudo find / -name mysql 找到mysql的bin目录
我这里是 /usr/local/Cellar/mysql@5.7/5.7.25/bin
3. export PATH=$PATH:/usr/local/mysql/bin
4. brew install openssl
5. export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/