Install Python 3.6.3 on CentOS 7.4.
$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
Install git.
$ sudo yum install -y git
Get the Pyenv installer from git.
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
Enable it through the path to Pyenv.
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
$ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
Check the version of Pyenv
$ pyenv -v
pyenv 1.1.5-40-g5b5df15
Install the packages needed to install Python.
$ sudo yum install -y zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel gcc libffi-devel
Check the version of Python that you can install using Pyenv.
$ pyenv install -l
Specify and install the latest version of Python 3.6.3 as of November 17, 2017.
$ pyenv install 3.6.3
Sets the version of Python to use.
$ pyenv global 3.6.0
Check the version.
$ python --version
Python 3.6.0
accomplished.
2018/9/26 Added "libffi-devel" to the installed package to support python 3.7.0
Recommended Posts