【问题标题】:openssl@1.1 not used? dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylibopenssl@1.1 没用过? dyld:库未加载:/usr/local/opt/openssl/lib/libssl.1.0.0.dylib
【发布时间】:2020-11-28 03:39:24
【问题描述】:

在尝试通过 pyenv 安装 python 时,我遇到了令人沮丧的 openssl 动态链接错误,即使我在几个月前通过自制软件安装和配置了 openssl@1.1:

$ pyenv install -v 3.8.2
pyenv: /Users/fire/.pyenv/versions/3.8.2 already exists
continue with installation? (y/N) y
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807114817.54648 ~/projects
Downloading Python-3.8.2.tar.xz...
-> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/libssh2/lib/libssh2.1.dylib
  Reason: image not found
/usr/local/bin/python-build: line 355: 55387 Abort trap: 6           aria2c --allow-overwrite=true --no-conf=true -o "${out}" ${ARIA2_OPTS} "$1" 1>&4
error: failed to download Python-3.8.2.tar.xz

BUILD FAILED (OS X 10.14.6 using python-build 20180424)

我仔细检查了所有路径中的openssl@1.1,尝试通过自制软件等重新安装 pyenv,但到目前为止没有任何效果。

【问题讨论】:

    标签: openssl homebrew dyld pyenv libssh2


    【解决方案1】:

    简而言之:检查库引用缺少的动态库,并确认您在将 openssl 版本更改为后重新构建了 它们好吧。
    您可以通过brew upgrade 进行版本升级或通过brew reinstall 重新安装有问题的软件包来重建。

    为什么? Homebrew 似乎不认为 libssh2openssl@1.1 的依赖项,因此不会像其他情况那样自动重建它。


    调查调试过程:

    在绞尽脑汁、google 和 SO 一个小时后,我又重新审视了失败:

    dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
      Referenced from: /usr/local/opt/libssh2/lib/libssh2.1.dylib
      Reason: image not found
    

    从那里,我注意到 libssh2 是引用失败的原因:

      Referenced from: /usr/local/opt/libssh2/lib/libssh2.1.dylib
    

    一时兴起,我检查了安装的 libssh2 homebrew 的版本:

    $ brew info libssh2
    libssh2: stable 1.9.0 (bottled), HEAD
    C library implementing the SSH2 protocol
    https://libssh2.org/
    /usr/local/Cellar/libssh2/1.8.0 (182 files, 798.7KB) *
      Poured from bottle on 2018-11-14 at 17:45:34
    From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libssh2.rb
    License: BSD-3-Clause
    ==> Dependencies
    Required: openssl@1.1 ✔
    ==> Options
    --HEAD
        Install HEAD version
    ==> Analytics
    install: 38,765 (30 days), 110,674 (90 days), 607,725 (365 days)
    install-on-request: 2,946 (30 days), 4,789 (90 days), 19,954 (365 days)
    build-error: 0 (30 days)
    

    啊,可能是这样!这是 2018 年安装的!

      Poured from bottle on 2018-11-14 at 17:45:34
    

    稍后一个brew upgrade libssh2,我们开始营业了

    ==> Upgrading 1 outdated package:
    libssh2 1.8.0 -> 1.9.0_1
    ==> Upgrading libssh2 1.8.0 -> 1.9.0_1
    ==> Downloading https://homebrew.bintray.com/bottles/libssh2-1.9.0_1.mojave.bottle.tar.gz
    ==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/327c56ad6a54894e5ef9aa3019d2444d32f1d0fba80925940100e517dd3109c9?response-content-disposition=attachment%3Bfilename%3D%22libssh2-1.9.0_1.mojave.bottle.tar.gz%22&Policy
    ######################################################################## 100.0%
    ==> Pouring libssh2-1.9.0_1.mojave.bottle.tar.gz
    ?  /usr/local/Cellar/libssh2/1.9.0_1: 184 files, 942KB
    Removing: /usr/local/Cellar/libssh2/1.8.0... (182 files, 798.7KB)
    
    ...
    
    

    然后,我们最初的问题就解决了:

    $ pyenv install -v 3.8.2
    pyenv: /Users/fire/.pyenv/versions/3.8.2 already exists
    continue with installation? (y/N) y
    python-build: use openssl@1.1 from homebrew
    python-build: use readline from homebrew
    /var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918 ~/projects
    Downloading Python-3.8.2.tar.xz...
    -> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
    
    08/07 11:53:54 [NOTICE] Downloading 1 item(s)
    [#25162c 0B/0B CN:1 DL:0B]
    
    08/07 11:53:55 [NOTICE] Allocating disk space. Use --file-allocation=none to disable it. See --file-allocation option in man page for more details.
    [#25162c 9.0MiB/17MiB(52%) CN:1 DL:9.8MiB]
    
    08/07 11:53:56 [NOTICE] Download complete: /private/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918/Python-3.8.2.tar.xz
    
    Download Results:
    gid   |stat|avg speed  |path/URI
    ======+====+===========+=======================================================
    25162c|OK  |   9.9MiB/s|/private/var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918/Python-3.8.2.tar.xz
    
    Status Legend:
    (OK):download completed.
    /var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918/Python-3.8.2 /var/folders/c3/cmbbfq710rvdh4l82q2h_86ds4cblh/T/python-build.20200807115352.60918 ~/projects
    Installing Python-3.8.2...
    python-build: use readline from homebrew
    python-build: use zlib from xcode sdk
    checking build system type... x86_64-apple-darwin18.7.0
    
    ...
    

    【讨论】:

      【解决方案2】:

      我今天遇到了同样的问题,但就我而言,libssh2 已经是最新的了。

      对我有用的是重新安装libssh2

      brew reinstall libssh2
      

      【讨论】:

        猜你喜欢
        • 2020-03-19
        • 2020-05-11
        • 1970-01-01
        • 2021-07-21
        • 2021-11-12
        • 2020-04-03
        • 1970-01-01
        • 2022-11-10
        相关资源
        最近更新 更多