2019-07-03 OSX 安装 mysqlclient 报错 ld: library not found for -lssl

clang -bundle -undefined dynamic_lookup build/temp.macosx-10.14-x86_64-3.7/_mysql.o -L/usr/local/Cellar/mysql/8.0.16/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.14-x86_64-3.7/_mysql.cpython-37m-darwin.so
  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
  ----------------------------------------
  ERROR: Failed building wheel for mysqlclient
  Running setup.py clean for mysqlclient
  Building wheel for uWSGI (setup.py) ... done
  Stored in directory: /Users/Qinfei/Library/Caches/pip/wheels/09/49/31/3098c71b6fe30eaedc682a589fe65ce9fcf8411281d4e05ec8
Successfully built uWSGI
Failed to build mysqlclient
Installing collected packages: pytz, Django, django-mathfilters, redis, django-redis, django-suit, mysqlclient, passlib, Pillow, uWSGI
  Running setup.py install for mysqlclient ... error

主要的报错信息是这个:

    ld: library not found for -lssl    # 主要信息在这里 

gcc找不到这个库

我们使用以下便可解决

brew install openssl
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/opt/openssl/lib/ 

参考资料:
ld: library not found for -lssl after Mac OS Sierra upgrade · Issue #795 · brianmario/mysql2​github.com

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值