pyenv のインストール
システムにインストールされている Python とは別のバージョンの Python を pyenv にインストールします。
sudo dnf -y install gcc zlib-devel bzip2 bzip2-devel readline readline-devel sqlite sqlite-devel openssl openssl-devel git libffi-devel xz-devel
次に、pyenvのクローンをホームディレクトリに作成します。
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
bash_profileにpyenvのパスを追加します。以下のコマンドをそれぞれ実行します。
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
無事インストールされたか、以下のコマンドを実行してみます。バージョン情報が表示されれば完了です。
pyenv -v