brew installopenssl
brewinstallmysql
brewinstall mysql-client
brewinstall mysql-connector-c
pipinstall mysqlclient
vim ~/.zshrc
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib
如果不配置openssl环境变量就会出现如下异常
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting mysqlclient
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/d0/97/7326248ac8d5049968bf4ec708a5d3d4806e412a42e74160d7f266a3e03a/mysqlclient-1.4.6.tar.gz (85 kB)
|████████████████████████████████| 85 kB 1.2 MB/s
Installing collected packages: mysqlclient
Running setup.pyinstall formysqlclient ... error
ERROR: Command errored out with exit status1:
command:/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c ‘import sys, setuptools, tokenize; sys.argv[0] =‘"‘"‘/private/var/folders/kx/6dph_b395sj9s8hmjf