By using pyenv-virtualenv, you can manage the environment for each version of Python + version. It is an indispensable tool when you want to use various Python versions and want to build different environments with the same version.
$ sudo yum install -y zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel git gcc
Simply download the executable from GitHub and pass it through the path to complete the installation.
Since pyenv-virtualenv is a plugin for pyenv, first install pyenv and then install pyenv-virtualenv in the plugin folder.
$ git clone https://github.com/pyenv/pyenv.git ~/.pyenv
$ git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
Many articles install it in / usr / local /
, but here we will install it in ~ /
according to the official installation method.
Add the following to ~ / .bash_profile
and pass the path.
.bash_profile
export PYENV_ROOT="$HOME/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
After that, reload ~ / .bash_profile
and execute the initialization process of pyenv.
$ source ~/.bash_profile
This continuation is the same as the Mac version, so [here](http://qiita.com/uhooi/items/b2f3a121b2e9dac6a256#python3%E7%B3%BB%E3%81%AE%E3%82%A4%E3% Please refer to 83% B3% E3% 82% B9% E3% 83% 88% E3% 83% BC% E3% 83% AB).
Since we want to build the environment of CentOS as minimally as possible, it is better to install it with pyenv install 3.6.1
instead of Anaconda, and install only the necessary packages additionally.
Recommended Posts