简而言之:检查库引用缺少的动态库,并确认您在将 openssl 版本更改为后重新构建了 它们好吧。
您可以通过brew upgrade 进行版本升级或通过brew reinstall 重新安装有问题的软件包来重建。
为什么? Homebrew 似乎不认为 libssh2 是 openssl@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
...