无法在 RHEL 上通过 pyenv 安装 python

Can't install python by pyenv on RHEL

在 RHEL7.6 上安装 pyenv

已安装必要的库 wiki

sudo yum install @development zlib-devel bzip2 bzip2-devel readline-devel sqlite \
sqlite-devel openssl-devel xz xz-devel libffi-devel findutils

检查可用安装列表

$ pyenv install --list | grep 3.8.2
  3.8.2

安装时出现错误:

$ pyenv install 3.8.2
Downloading Python-3.8.2.tar.xz...
-> https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz
error: failed to download Python-3.8.2.tar.xz

BUILD FAILED (Red Hat Enterprise Linux Server 7.6 using python-build 1.2.18-7-gae4d489)

甚至尝试设置代理,但仍然是同样的错误。

OS的信息是

$ cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.6 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.6"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.6 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.6:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.6
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.6"

尝试从https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tar.xz下载源码包并放入pyenv缓存$(pyenv root)/cache/.

然后重试pyenv install 3.8.2

https://github.com/pyenv/pyenv/issues/1476