[英]Unable to install Python build with shared library using pyenv on MacOS 11.1
[英]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.