in the CentOS7 through pyenv installation Python3 and virtualenv
centos default installation python version is 2.7 centos installation on the server Span style= "FONT-FAMILY:CALIBRI;" >python3
because Many of the tools in the CentOS system are dependent on the Python2.7.5 of the system , so in order not to affect the use of Python2.7.5 , use Pyenv for environmental isolation. virtualenv is used to create a separate python environment for each Python app .
Step 1. Update System
$ sudo yum-y update
Step 2. Install dependent environments
$ sudo yum install-y gcc git openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel patch
Step 3. installation pyenv
$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
Step 4. Configuring environment Variables
$ Echo ' Export path= ' $HOME/.pyenv/bin: $PATH "' >>. BASHRC
$ Echo ' eval ' $ (pyenv init-) ' >>. BASHRC
$ source. BASHRC
The following results have been successfully installed.
$ pyenv Version
System (set By/home/logan/.pyenv/version)
Step 4. installation Python3
You can use pyenv install-lto view supported versions of the installation
$ pyenv Install--list
Available Versions:
2.1.3
2.2.3
... ..
3.5.1
3.5.2
3.6.0b3
3.6-dev
Installing 3.5.2
$ pyenv Install 3.5.2
Version switching
$ pyenv Global 3.5.2
$ pyenv Rehash
View Python version
$ python –version
Step 5. installation virtualenv
$ pip Install virtualenv
Create a virtual environment
$ virtualenv ENV
Start the virtual environment
$ source Env/bin/active
Exit the Environment
Deactivate
This article is from the "Keep Keep your" blog, be sure to keep this source http://keep88.blog.51cto.com/11829099/1920763
CENTOS7 deploying pyenv To install Python multiple versions