Python3 environment construction with pyenv-virtualenv (CentOS 7.3)

Introduction

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.

environment

Installation of dependent libraries

$ sudo yum install -y zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel git gcc

Install pyenv-virtualenv

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.

Reference link

Recommended Posts

Python3 environment construction with pyenv-virtualenv (CentOS 7.3)
Get started with Python! ~ ① Environment construction ~
Python environment construction
Environment construction (python)
python environment construction
Python --Environment construction
Python environment construction
Using Chainer with CentOS7 [Environment construction]
pytorch @ python3.8 environment construction with pipenv
python environment construction
Environment construction with pyenv and pyenv-virtualenv
[Ubuntu 18.04] Python environment construction with pyenv + pipenv
Let's get along with Python # 0 (Environment construction)
python windows environment construction
Python development environment construction
Python environment with docker-compose
python2.7 development environment construction
Mac environment construction Python
Virtual environment with Python 3.6
Python environment construction @ Win7
Collecting information from Twitter with Python (Environment construction)
Build a python environment with ansible on centos6
Poetry-virtualenv environment construction with python of centos-sclo-rh ~ Notes
Python 3.x environment construction by Pyenv (CentOS, Ubuntu)
First python ① Environment construction with pythonbrew & Hello World !!
From Python environment construction to virtual environment construction with anaconda
Python + Anaconda + Pycharm environment construction
About Linux environment construction (CentOS)
python (pyenv + pyenv-virtualenv) + CentOS7 installation
Install Python environment with Anaconda
Manage python environment with virtualenv
Anaconda environment construction on CentOS7
Python environment construction (Windows10 + Emacs)
CI environment construction ~ Python edition ~
Build python3 environment with ubuntu 16.04
ML environment construction with Miniconda
Python environment construction For Mac
Anaconda3 python environment construction procedure
Prepare python3 environment with Docker
Build python environment with direnv
Python environment construction and TensorFlow
Python environment construction under Windows7 environment
[MEMO] [Development environment construction] Python
Environment construction of python2 & 3 (OSX)
Virtual environment construction with Docker + Flask (Python) + Jupyter notebook
Build a python environment for each directory with pyenv-virtualenv
Data analysis environment construction with Python (IPython notebook + Pandas)
Web application made with Python3.4 + Django (Part.1 Environment construction)
QGIS3 Python plugin development environment construction with VSCode (macOS)
[Python] Django environment construction (pyenv + pyenv-virtualenv + Anaconda) for macOS
OpenJTalk on Windows10 (Speak Japanese with Python from environment construction)
Python environment construction memo on Windows 10
Anaconda python environment construction on Windows 10
Build python virtual environment with virtualenv
Setup modern Python environment with Homebrew
Python + Unity Reinforcement learning environment construction
ruby environment construction with aws EC2
[LDAP environment construction: 7] Add / search / change / delete users with Python
Construction of Python local development environment Part 2 (pyenv-virtualenv, pip usage)
I checked Mac Python environment construction
Build Mysql + Python environment with docker