AMI: Amazon Linux AMI 2018.03.0 (HVM), SSD Volume Type
$ sudo yum install python36
$ python3 --version
$ sudo yum install git
$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
$ emacs ~/.bash_profile
$ source ~/.bash_profile
$ sudo yum install zlib1g-dev
$ sudo yum install libssl-dev
$ sudo yum install gcc zlib-devel bzip2 bzip2-devel readline readline-devel sqlite sqlite-devel openssl openssl-devel -y
$ pyenv install 3.6.8
$ pyenv global 3.6.8
$ pyenv rehash
$ python --version
.bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
$ python --version
It should be okay if the execution result of is 3 system
Installing Python on Linux Switch Python from 2 to 3 !! Building Python3 environment on EC2 server
[Amazon Linux] Command to switch from Python 2 series to Python 3 series
Recommended Posts