Fai*_*zer 25 python libcrypto oh-my-zsh macos-catalina
我使用新的macOS Catalina运行了Django项目,并且运行良好。
我安装了oh_my_zsh,然后尝试运行它因以下错误而崩溃的同一项目。我卸载了oh_my_zsh并再次尝试,但没有成功。
Path:                  /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.7.4 (3.7.4)
Code Type:             X86-64 (Native)
Parent Process:        Python [7526]
Responsible:           Terminal [7510]
User ID:               501
Date/Time:             2019-10-07 20:59:20.675 +0530
OS Version:            Mac OS X 10.15 (19A582a)
Report Version:        12
Anonymous UUID:        CB7F20F6-96C0-4F63-9EC5-AFF3E0989687
Time Awake Since Boot: 3000 seconds
System Integrity Protection: enabled
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY
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.
Run Code Online (Sandbox Code Playgroud)
    Ton*_*ark 63
对我来说,重新安装 Python 的密码学包就足够了。
pip uninstall cryptography
pip install cryptography
Run Code Online (Sandbox Code Playgroud)
        bix*_*xel 35
我只是遇到了同样的问题,手动链接周围的东西有点不舒服。
我能够通过简单地解决问题
brew install openssl
Run Code Online (Sandbox Code Playgroud)export DYLD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$DYLD_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)我刚刚将该行添加到我的.zshrc中。
编辑:根据这个问题,的使用DYLD_FALLBACK_LIBRARY_PATH可能比更好DYLD_LIBRARY_PATH。
hon*_*boy 30
警告:我不是安全专家,该解决方案与加密库混淆!
我认为您的问题不是源于zsh或oh-my-zsh。我的最佳猜测:MacOS 10.15上安装的某些加密库与Homebrew的python3安装不兼容。
这是为我解决问题的原因
# Install openssl via homebrew.
# Note: According to homebrew, "openssl is keg-only, which means it was
# not symlinked into /usr/local, because Apple has deprecated use of
# OpenSSL in favor of its own TLS and crypto libraries."
brew install openssl
# Symlink those versions into /usr/local/lib, which gets Python to dynamically
# link against those instead of the version in /usr/lib/.
# Got the idea from https://forums.developer.apple.com/thread/119429
cd /usr/local/lib
sudo ln -s /usr/local/Cellar/openssl/1.0.2t/lib/libssl.1.0.0.dylib libssl.dylib
sudo ln -s /usr/local/Cellar/openssl/1.0.2t/lib/libcrypto.1.0.0.dylib libcrypto.dylib
Run Code Online (Sandbox Code Playgroud)
我的情况:
brew install pythonpip3 失败了 SIGABRT系统错误报告的标题:
Process:               Python [52429]
Path:                  /usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier:            Python
Version:               3.7.4 (3.7.4)
Code Type:             X86-64 (Native)
Parent Process:        zsh [43309]
Responsible:           iTerm2 [2316]
User ID:               501
Date/Time:             2019-10-09 09:52:18.148 -0700
OS Version:            Mac OS X 10.15 (19A583)
Report Version:        12
Bridge OS Version:     4.0 (17P572)
Anonymous UUID:        
Sleep/Wake UUID:       
Time Awake Since Boot: 9900 seconds
Time Since Wake:       7300 seconds
System Integrity Protection: enabled
Crashed Thread:        0  Dispatch queue: com.apple.main-thread
Exception Type:        EXC_CRASH (SIGABRT)
Exception Codes:       0x0000000000000000, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY
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.
Run Code Online (Sandbox Code Playgroud)
        Apple Dev线程中的r.xuanInvalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI. 
通过将libssl.dylib和libcrypto.dylib链接替换为/usr/local/libHomebrew安装的lib的链接,从而确定了该错误的解决方法的步骤
 openssl。
获取新的库
1) brew update && brew upgrade && brew install openssl
2) cd /usr/local/Cellar/openssl/1.0.2t/lib
3) sudo cp libssl.1.0.0.dylib libcrypto.1.0.0.dylib /usr/local/lib/
备份旧的
4) cd /usr/local/lib
5) mv libssl.dylib libssl_bak.dylib
6) mv libcrypto.dylib libcrypto_bak.dylib
建立新连结
7) sudo ln -s libssl.1.0.0.dylib libssl.dylib
8) sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib
我更喜欢@ bixel,@ Juro Oravec和@honkaboy的组合答案:
brew install openssl
cd /usr/local/lib
sudo ln -s /usr/local/opt/openssl/lib/libssl.dylib libssl.dylib
sudo ln -s /usr/local/opt/openssl/lib/libcrypto.dylib libcrypto.dylib
Run Code Online (Sandbox Code Playgroud)
这样,至少在理论上,当更新openssl时,dylib将始终指向最新版本。/usr/local/opt/openssl实际上是一个链接/usr/local/Cellar/openssl/Cellar/openssl/1.0.2t(brew安装的openssl版本)。
这个问题发生的原因实际上是由brew解释的:
openssl是仅桶式的,这意味着它没有符号链接到/ usr / local,因为Apple已弃用OpenSSL而不是使用其自己的TLS和加密库。
尝试运行brew link openssl:
警告:拒绝链接macOS提供的软件:openssl如果需要首先在运行PATH中运行openssl:echo'export PATH =“ / usr / local / opt / openssl / bin:$ PATH”'>>〜/ .bash_profile
为了使编译器能够找到openssl,您可能需要设置:export LDFLAGS =“-L / usr / local / opt / openssl / lib” export CPPFLAGS =“-I / usr / local / opt / openssl / include”
为了使pkg-config查找openssl,您可能需要设置:export PKG_CONFIG_PATH =“ / usr / local / opt / openssl / lib / pkgconfig”
因此,基本上,您需要手动链接它们。
我看到了类似的问题ansible。罪魁祸首是asn1crypto,问题已经解决。
我的解决方案是手动删除它并使用以下命令重新安装它pip:
rm -r /usr/local/lib/python2.7/site-packages/asn1crypto*. 这允许pip工作没有问题。pip install asn1crypto,其中安装1.2.0:  Found existing installation: asn1crypto 0.24.0
    Uninstalling asn1crypto-0.24.0:
      Successfully uninstalled asn1crypto-0.24.0
Successfully installed asn1crypto-1.2.0
Run Code Online (Sandbox Code Playgroud)
注意:您可以asn1crypto通过python在详细模式下运行来检查是否是罪魁祸首,例如python -v $(which ansible). 在我的情况下,它在执行一些asn1crypto相关导入时崩溃了:
# /usr/local/lib/python2.7/site-packages/asn1crypto/_perf/_big_num_ctypes.pyc matches /usr/local/lib/python2.7/site-packages/asn1crypto/_perf/_big_num_ctypes.py
import asn1crypto._perf._big_num_ctypes # precompiled from /usr/local/lib/python2.7/site-packages/asn1crypto/_perf/_big_num_ctypes.pyc
[1]    59247 abort      python -v $(which ansible)
Run Code Online (Sandbox Code Playgroud)
相关:https : //github.com/Homebrew/homebrew-core/issues/44996
|   归档时间:  |  
           
  |  
        
|   查看次数:  |  
           4531 次  |  
        
|   最近记录:  |