安装mysqlclient报错

2020-02-24  本文已影响0人  leejnull

安装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/

上一篇 下一篇

猜你喜欢

热点阅读