3
2

More than 3 years have passed since last update.

作業メモ Amazon linux2にpyenvでpython3.9.0をインストールする

Last updated at Posted at 2021-05-24

手順

# 使う諸々インストール
sudo yum -y install   bzip2   bzip2-devel   gcc   git   libffi-devel   make   openssl   openssl-devel   readline   readline-devel   sqlite   sqlite-devel   zlib-devel

# pyenvインストール
curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

# bashrc書き換え
cat << 'EOS' >> ~/.bashrc
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
EOS

source ~/.bashrc

pyenv install 3.9.0

pyenv global 3.9.0

python -V
# Python 3.9.0

雑記

# インストールできるpython一覧確認
pyenv install --list

# amazon-linux-extras関係のエラーが出たら
ln -s /lib/python2.7/site-packages/amazon_linux_extras ~/.pyenv/versions/3.9.0/lib/python3.7/site-packages/

参考

3
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2