mac python 出现 “Abort trap: 6” 问题

mac python 出现 “Abort trap: 6” 问题

0. 现象

python 程序自动退出

  • 命令行下显示 Abort trap: 6
  • pycharm 显示 Process finished with exit code 134 (interrupted by signal 6:SIGABRT)

1. 查看 python 日志

日志位置 ~/Library/Logs/DiagnosticReports,有 .crash 后缀的日志文件

Application Specific Information:
/usr/lib/libcrypto.dylib
abort() called
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.

2. 原因

如日志所说,libcryptodylibunversioned

3. 解决办法

注意下面但位置不一定是 /usr/local/Cellar/openssl/1.0.2t/lib,比如我的环境就是 /usr/local/Cellar/openssl/1.0.2q/lib

brew update && brew upgrade && brew install openssl
## note: some people report that the dylib files needed in #3 are in the 1.0.2t folder, rather than the lib folder. adjust your path in #2 as needed.
cd /usr/local/Cellar/openssl/1.0.2t/lib
sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib/
cd /usr/local/lib
sudo ln -s libssl.1.0.0.dylib libssl.dylib
sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib

替换后再运行就行了

参考 & 其他解决方案 (可忽略)

  • https://github.com/pypa/pip/issues/7254
  • https://forums.developer.apple.com/thread/119429
This is related to pyopenssl using old dependencies. 
You can fix it by removing the cryptography package, then upgrading cryptography to version 2.8.
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值