#
상황#
python 2.7.x 설치learnuv라는, libuv를 실습해 볼 수 있는 도구를 설치하려고 하는데 python 2.7이 필요하다.
그래서 pyenv로 python 2.7.18을 설치하려고 했다.
#
문제#
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?$ pyenv install 2.7.18
Downloading Python-2.7.18.tar.xz...-> https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xzInstalling Python-2.7.18...python-build: use readline from homebrewERROR: 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
BUILD FAILED (Ubuntu 20.04 using python-build 20180424)
Inspect or clean up the working tree at /tmp/python-build.20210930080648.5949Results logged to /tmp/python-build.20210930080648.5949.log
Last 10 log lines:rm -f /home/david/.pyenv/versions/2.7.18/share/man/man1/python.1(cd /home/david/.pyenv/versions/2.7.18/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
#
조사#
핵심 오류 파악핵심 오류 메시지는 아래와 같다.
danger
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
OpenSSL 라이브러리와 관련된 문제인 것 같다.
#
해결 방법 검색일단 오류 메시지 그대로 구글에 검색해보았다.
찾는 결과가 바로 나왔다.
#
해결#
libssl-dev 설치sudo apt install -y libssl-dev
#
결과libssl-dev
를 설치한 후에 다시 python 2.7.18을 설치하니 제대로 된다.
$ pyenv install 2.7.18
Downloading Python-2.7.18.tar.xz...-> https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xzInstalling Python-2.7.18...python-build: use readline from homebrewInstalled Python-2.7.18 to /home/david/.pyenv/versions/2.7.18