エラー内容
fedora36にて
pyenv install 3.8.13
を実行し、python3.8.13をインストールしようとしたら
Downloading Python-3.8.13.tar.xz...
-> https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tar.xz
Installing Python-3.8.13...
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
WARNING: The Python curses extension was not compiled. Missing the ncurses lib?
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
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
BUILD FAILED (Fedora Linux 36 using python-build 20180424)
Inspect or clean up the working tree at /tmp/python-build.20220918205119.66482
Results logged to /tmp/python-build.20220918205119.66482.log
Last 10 log lines:
./python -E -m ensurepip \
$ensurepip --root=/ ; \
fi
Looking in links: /tmp/tmpkvcgm8zh
Processing /tmp/tmpkvcgm8zh/setuptools-56.0.0-py3-none-any.whl
Processing /tmp/tmpkvcgm8zh/pip-22.0.4-py3-none-any.whl
Installing collected packages: setuptools, pip
WARNING: The scripts pip3 and pip3.8 are installed in '/home/***/.pyenv/versions/3.8.13/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-22.0.4 setuptools-56.0.0
となってBUILD FAILEDとなった。
解決策
openssl1.1-develをインストール
↑からopenssl1.1-devel
のrpmパッケージをローカルにダウンロードして
(ダウンロードリンク)
sudo dnf -y localinstall ./openssl1.1-devel-1.1.1n-1.fc36.x86_64.rpm
を実行することでopenssl1.1-devel
をインストール。
pyenv install
を再実行
pyenv install インストールしたバージョン
参考
エラー情報に
https://github.com/pyenv/pyenv/wiki/Common-build-problems
を参照しろとのガイドがありました。
ただ、↑のwikiには
sudo yum install openssl11-devel --allowerasing
でopenssl11-devel
をインストールすることが書かれていたものの、Fedora36で実行すると
No match for argument: openssl11-devel
Error: Unable to find a match: openssl11-devel
となるので、RPMパッケージをローカルにダウンロードすることで解決しました。