brew install mysql
brew install mysql-client
brew install openssl
brew info openssl
将这两行导入环境
之后在项目下pip install mysqlclient
...
In file included from MySQLdb/_mysql.c:29:
In file included from /usr/local/opt/mysql-client/include/mysql/mysql.h:46:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/types.h:81:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/endian.h:37:2: error: architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command 'clang' failed with exit status 1
export ARCHFLAGS="-arch x86_64"
然后再次安装mysqlclient即可。
即安装成功