Install Python on CentOS using Pyenv

Install Python 3.6.3 on CentOS 7.4.

OS information

$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

Install Pyenv

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

Python installation

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

Install Python on CentOS using Pyenv
Install Python on CentOS using pyenv
Install Python3.4 on CentOS 6.6
[CentOS7] Install anaconda using pyenv
Install Python 3.8 on CentOS 7 (SCL)
Install Python 3.8 on CentOS 8 (AppStream)
Introducing Python using pyenv on Ubuntu 20.04
Notes on installing Python using PyEnv
CentOS8 --Install --Python3
Install python library on Lambda using [/ tmp]
Install pyenv and Python 3.6.8 on Ubuntu 18.04 LTS
Install pyenv and rbenv on CentOS system-wide
Install Faiss on CentOS 7
Install pyenv on mac
Install Python on Pidora.
Install Scrapy on python3
Install numba on CentOS 7.2
Install Python on Mac
Install Python 3 on Mac
Install python (pyenv, pyenv-virtualenv)
Install python on windows
Install mecab-python on CentOS
Install python with pyenv
Install Python 3.3 on Ubuntu 12.04
Install Python 3.4 on Mac
Install pyenv on OSX
Install awscli on centos7
Install Chainer on CentOS 6.7
Install Python 3.6 on Docker
Install watchdog on Windows + Python 3.3
Install pygame on python3.4 on mac
Install ImageMagick-6.2.x series on CentOS7.7
Install pandas 0.14 on python3.4 [on Mac]
Install Python 3.7 and Django 3.0 (CentOS)
Install OpenCV on Ubuntu + python
Install Chrome on CentOS 7 series
Install pyenv from Homebrew, install Python from pyenv
Broadcast on LINE using python
[Python] [Chainer] [Windows] Install Chainer on Windows
Notes on installing Python on CentOS
Initial settings for using Python3.8 and pip on CentOS8
Build a Python environment on your Mac using pyenv
Build a Python development environment using pyenv on MacOS
Install pyenv on Raspberry Pi and version control Python
Install Python environment on local PC (pyenv, venv on Mac)
Minimum memo when using Python on Mac (pyenv edition)
How to install python using anaconda
Install Python Pillow on Amazon Linux
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Steps to install MySQL 8.0 on CentOS 8.1
Install Python3 on Sakura server (FreeBSD)
raspberry pi 4 centos7 install on docker
install python
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Notes on using MeCab from Python
Install xgboost (python version) on Windows
Preparing python using vscode on ubuntu
Install Python on Windows + pip + virtualenv
Steps to install VirtualBox on CentOS
Install Python 3.7 Anaconda on MAC, but Python 2
Install python3 on Mac (El Capitan)