安装mysqlclient报错

安装mysqlclient,报错,一般问题卡在这里

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1

首先确保安装了openssl

brew install openssl

我两台mac用了两种解决方式,很奇怪为什么同一种方式不行,可能是系统版本不一样

  1. MacOS 10.14
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/ 

然后执行安装即可

pip3.8 install mysqlclient
  1. MacOS 10.15
LDFLAGS=-L/usr/local/opt/openssl/lib pip3.8 install mysqlclient

我的个人博客 https://leejnull.github.io/2020/02/24/2020-02-24-01/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。