CENTOS7 deploying pyenv To install Python multiple versions

Source: Internet
Author: User
Tags virtual environment virtualenv

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.