gpt4 book ai didi

macos-catalina - pyenv:构建失败(OS X 10.15.7 使用 python-build 20180424)

转载 作者:行者123 更新时间:2023-12-04 15:15:48 25 4
gpt4 key购买 nike

我刚刚在 macOS Catalina 上安装了 pyenv,使用命令 pyenv doctor 收到以下错误消息:

Cloning /Users/joel.rontynen/.pyenv/plugins/pyenv-doctor/bin/.....
Installing python-pyenv-doctor...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

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

Inspect or clean up the working tree at /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201014132428.46509
Results logged to /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201014132428.46509.log

Last 10 log lines:
checking readline/readline.h, presence... no
checking for readline/readline.h,... no
checking readline/rlconf.h usability... yes
checking readline/rlconf.h presence... yes
checking for readline/rlconf.h... yes
checking for SSL_library_init in -lssl... no
configure: WARNING: OpenSSL <1.1 not installed. Checking v1.1 or beyond...
checking for OPENSSL_init_ssl in -lssl... no
configure: error: OpenSSL is not installed.
make: *** No targets specified and no makefile found. Stop.
Problem(s) detected while checking system.

See https://github.com/pyenv/pyenv/wiki/Common-build-problems for known solutions.
日志文件如下所示:
/var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201021121358.92440 ~
Cloning into 'python-pyenv-doctor'...
warning: --depth is ignored in local clones; use file:// instead.
done.
/var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201021121358.92440/python-pyenv-doctor /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201021121358.92440 ~
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for rl_gnu_readline_p in -lreadline... yes
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking readline/readline.h, usability... no
checking readline/readline.h, presence... no
checking for readline/readline.h,... no
checking readline/rlconf.h usability... yes
checking readline/rlconf.h presence... yes
checking for readline/rlconf.h... yes
checking for SSL_library_init in -lssl... no
configure: WARNING: OpenSSL <1.1 not installed. Checking v1.1 or beyond...
checking for OPENSSL_init_ssl in -lssl... no
configure: error: OpenSSL is not installed.
make: *** No targets specified and no makefile found. Stop.
我使用 Homebrew 安装了 pyenv 和 pyenv-virtualenv,并通过克隆 GitHub 存储库安装了更新和医生附加组件。命令 brew list给出以下输出:
fig             pyenv-virtualenv    xz
openssl@1.1 pyenv readline
我的 .zshrc 文件如下所示:
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
和 .zshenv 文件是这样的:
eval "$(pyenv virtualenv-init -)"
我不确定还有哪些其他信息是相关的,因此您可以在评论中询问更多信息。

最佳答案

问题是随 Homebrew 一起安装的 OpenSSL,但它“没有符号链接(symbolic link)到/usr/local,因为 macOS 提供了 LibreSSL。”我通过运行命令 brew info openssl 了解到这一点,这说

openssl@1.1: stable 1.1.1h (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/openssl@1.1/1.1.1h (8,067 files, 18.5MB)
Poured from bottle on 2020-10-14 at 12:44:32
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl@1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl@1.1/certs

and run
/usr/local/opt/openssl@1.1/bin/c_rehash

openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"

For pkg-config to find openssl@1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"
修复程序可以在上面的消息中的“==> 警告”行下找到。我将导出 LDFLAGS 和 CPPFLAGS 行添加到我的 ~/.zshrc 文件和 pyenv doctor 中命令不再给出任何错误。

关于macos-catalina - pyenv:构建失败(OS X 10.15.7 使用 python-build 20180424),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64353172/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com