Python crashing on MacOS 10.15 Beta (19A582a) with “/usr/lib/libcrypto.dylib”

前端 未结 13 525
星月不相逢
星月不相逢 2020-12-12 15:47

I ran my Django project with new macOS Catalina and was running fine.
I installed oh_my_zsh then I tried to run the same project it is crashing with the following errors

相关标签:
13条回答
  • 2020-12-12 16:19

    r.xuan from this Apple Dev thread identified the steps of a workaround for the error Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI. by replacing the libssl.dylib and libcrypto.dylib links in /usr/local/lib with links to libs from Homebrew's install of openssl.

    The steps are:

    Get fresh libs

    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/

    Backup the old ones

    4) cd /usr/local/lib

    5) mv libssl.dylib libssl_bak.dylib

    6) mv libcrypto.dylib libcrypto_bak.dylib

    Create new links

    7) sudo ln -s libssl.1.0.0.dylib libssl.dylib

    8) sudo ln -s libcrypto.1.0.0.dylib libcrypto.dylib

    0 讨论(0)
  • 2020-12-12 16:19

    It must be usage of some dependencies like cryptography

    Solution:

    cd your-site-packages-path/
    vim ./asn1crypto/_int.py
    

    find this line; delete it, and everything is ok

    # from ._perf._big_num_ctypes import libcrypto
    

    Here is my problem

    Process:               Python [85179]
    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:        ??? [85161]
    Responsible:           iTerm2 [11711]
    User ID:               501
    
    Date/Time:             2019-10-07 23:00:25.143 +0800
    OS Version:            Mac OS X 10.15 (19A582a)
    Report Version:        12
    Bridge OS Version:     3.0 (14Y906)
    Anonymous UUID:        32C73ADD-1291-FA0E-DC02-48D539674325
    
    
    Time Awake Since Boot: 42000 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.
    
    0 讨论(0)
  • 2020-12-12 16:19

    To follow the answers mentioned above, wanted to link libssl.dylib file but found is no such location as below:

    /usr/local/Cellar/openssl/1.0.2t/lib/
    

    However as the accepted answer by @bixel found the file in below location

    /usr/local/opt/openssl/lib
    

    and it worked for me.

    0 讨论(0)
  • 2020-12-12 16:22

    Looks like it was a Homebrew issue. I did brew reinstall python3 and it worked.

    0 讨论(0)
  • 2020-12-12 16:23

    Try:

    python3 -m pip install oscrypto
    

    Worked for me!

    0 讨论(0)
  • 2020-12-12 16:28

    I just came across the same problem and felt a bit uncomfortable to manually link things around.

    I was able to solve the problem by simply

    1. Installing openssl via homebrew:
      brew install openssl
      
    2. Pointing towards the dynamic libraries from openssl via DYLD_LIBRARY_PATH:
      export DYLD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$DYLD_LIBRARY_PATH
      

    I've just added that line to my .zshrc.

    Edit: According to this question, the usage of DYLD_FALLBACK_LIBRARY_PATH might be preferable over DYLD_LIBRARY_PATH.

    Edit 2: As mentioned in a comment below, this should probably be the accepted answer. Simply reinstall the cryptography package.

    0 讨论(0)
提交回复
热议问题