繁体   English   中英

无法使用 pyenv 安装 Python 3.8.5

[英]Unable to install Python 3.8.5 using pyenv

我正在尝试在 Centos 6 Docker 图像上使用 pyenv 安装 Python 3.8.5。 我收到以下错误:

正在下载 Python-3.6.12.tar.xz... -> https://www.python.org/ftp/python/3.6.12/Python-3.6.12.tar.xz安装 Python-3.6.12.. .

构建失败(使用 python-build 1.2.22-47-g4c302a0 的 CentOS 版本 6.10(最终版))

检查或清理 /tmp/python-build.20210131203049.150 处的工作树结果记录到 /tmp/python-build.20210131203049.150.log

Last 10 log lines: checking if g++ static flag -static works... no checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs...立即检查 size_t 的大小... 8 检查 C 编译器供应商... gcc -pthread -shared -L/root/.pyenv/versions/3.6.12/lib -L/root/.pyenv/versions/3.6.12 /lib -L/root/.pyenv/versions/3.6.12/lib -I/root/.pyenv/versions/3.6.12/include build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/ Python-3.6.12/Modules/pyexpat.o 构建/临时。 linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12/Modules/expat/xmlparse.o build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12 /Modules/expat/xmlrole.o build/temp.linux-x86_64-3.6/tmp/python-build.20210131203049.150/Python-3.6.12/Modules/expat/xmltok.o -L/root/.pyenv/versions/3.6 .12/lib -L/usr/local/lib -o build/lib.linux-x86_64-3.6/pyexpat.cpython-36m-x86_64-linux-gnu.so /bin/sh: line 9: 8442 Killed CC=' gcc -pthread' LDSHARED='gcc -pthread -shared -L/root/.pyenv/versions/3.6.12/lib -L/root/.pyenv/versions/3.6.12/lib ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS=''./python -E./setup.py $quiet build make: *** [sharedmods] 错误 137

看起来你缺少一个部门。 尝试这个:

$ sudo yum install openssl-devel

如果这还不够, https://joshspicer.com/python37-ssl-issue上提到了其他几个相关的部门

请注意,仅安装 openssl 是不够的。

您需要 package 的-devel形式。 它包含构建成功所必需的基本成分,例如*.h header 文件。


使用$ yum list installed查看你有哪些 ATM。 您可能会发现yum list installed | grep -i openssl yum list installed | grep -i openssl方便。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM