子钦加油

扩大
缩小

Mac中 pip3 install mysqlclient 报错

主要错误提示如下:

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

  ----------------------------------------
  Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient

最下方的报错是:

 

 

这个错误百度+Google查了很久都没有找到正确的解决方法,浪费了很多时间,使得我认为非常有必要把解决方法写出来,防止再有其他人浪费生命.真不知道为什么很少有人遇到和我同样的错误,唯一的解决方法是使用下方命令进行安装:

LDFLAGS=-L/usr/local/opt/openssl/lib pip3 install mysqlclient

下面是我的实例,在虚拟环境中安装的

LDFLAGS=-L/usr/local/opt/openssl/lib pip install mysqlclient

 

参考链接:https://github.com/PyMySQL/mysqlclient-python/issues/131

 

posted on 2019-12-10 14:22  子钦加油  阅读(996)  评论(0编辑  收藏  举报

导航

返回顶部