Eli Schwartz via arch-general <arch-general@xxxxxxxxxxxxx> 于2019年12月2日周一 下午2:38写道: > > On 12/2/19 1:00 AM, Hongyi Zhao via arch-general wrote: > > Hi, > > > > I try to compile python 2.7.9 with pyenv on arch linx with the > > following command: > > > > =========== > > $ pyenv install 2.7.9 > > Installing Python-2.7.9... > > patching file ./Lib/site.py > > patching file ./Lib/ssl.py > > ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib? > > > > Please consult to the Wiki page to fix the problem. > > https://github.com/pyenv/pyenv/wiki/Common-build-problems > > Well, the error message is pretty clear that the problem is "the OpenSSL > lib", so if you look on that wiki page for information about the OpenSSL > lib, you'll hit the following subcomponent of that page: > > https://github.com/pyenv/pyenv/wiki/Common-build-problems#error-the-python-ssl-extension-was-not-compiled-missing-the-openssl-lib Thanks a lot, based on this notes, I solved the problem. Regards > > It specifically calls out archlinux with an indication that this ancient > version of python requires an openssl version less than 1.1 (and > mentioning the name of the CFLAGS and LDFLAGS you'll need to > successfully compile ancient python in such cases). > > This matches the official python2 documentation: > https://docs.python.org/2.7/library/ssl.html > > "Changed in version 2.7.13: Updated to support linking with OpenSSL 1.1.0" > > > BUILD FAILED (Arch Linux using python-build 1.2.15-2-g22c0202) > > > > Inspect or clean up the working tree at /tmp/python-build.20191202134159.88051 > > Results logged to /tmp/python-build.20191202134159.88051.log > > > > Last 10 log lines: > > rm -f /home/werner/.pyenv/versions/2.7.9/share/man/man1/python.1 > > (cd /home/werner/.pyenv/versions/2.7.9/share/man/man1; ln -s python2.1 python.1) > > if test "xno" != "xno" ; then \ > > case no in \ > > upgrade) ensurepip="--upgrade" ;; \ > > install|*) ensurepip="" ;; \ > > esac; \ > > ./python -E -m ensurepip \ > > $ensurepip --root=/ ; \ > > fi > > ================== > > These log lines are useless, your problem has nothing to do with running > ensurepip. > > > -- > Eli Schwartz > Bug Wrangler and Trusted User > -- Hongsheng Zhao <hongyi.zhao@xxxxxxxxx> Institute of Semiconductors, Chinese Academy of Sciences GnuPG DSA: 0xD108493