Python Multi-version management tool PYENV installation

Source: Internet
Author: User
Tags gpg virtual environment

Python Multi-version management tool PYENV installation

1. Role

Managing the Python interpreter, Python version, Python's virtual environment

Software: https://github.com/pyenv/pyenv

2.PYENV Package Installation

A. Configure the Yum source (config file contents below)

VI Centos6-base-163.repo

[Base]

name=centos-$releasever-base-163.com

baseurl=http://mirrors.163.com/centos/6/os/$basearch/

Enable=1

Gpgcheck=0

Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6

#released Updates

[Updates]

name=centos-$releasever-updates-163.com

baseurl=http://mirrors.163.com/centos/6/updates/$basearch/

Gpgcheck=0

Enable=1

Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6

#additional packages that could be useful

[Extras]

name=centos-$releasever-extras-163.com

baseurl=http://mirrors.163.com/centos/6/extras/$basearch/

Gpgcheck=0

Enable=1

Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6

#additional packages that extend functionality of existing packages

[Centosplus]

name=centos-$releasever-plus-163.com

baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/

Gpgcheck=0

Enabled=1

Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6

#contrib-packages by Centos Users

[Contrib]

name=centos-$releasever-contrib-163.com

baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/

Gpgcheck=0

Enabled=1

Gpgkey=http://mirror.centos.org/centos/rpm-gpg-key-centos-6

B. Install Git software and dependency packages

Yum Install Git-y

Yum-y install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel

C. Create a user

Useradd python

passwd python

D. Install pyenv software

Curl-l Https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | Bash

E. Configure Environment variables

Vim ~/.bash_profile

Export path= "/home/python/.pyenv/bin: $PATH"

Eval "$ (pyenv init-)"

Eval "$ (pyenv virtualenv-init-)"

1.1.2  3. Installing and managing Python using pyenv Software

A. List all available versions

Pyenv versions

B. Install the specified Python version

pyenv Install 3.5.3-v

View Python version

Python-v

C, create a directory to have local bundled in a directory

Mkdir-p magedu/projects

CD magedu/projects/

Pyenv Local 3.5.3----------------#让python版本捆绑在一个目录下

Python-v

Python 3.5.3

CD-------#你看如果在其它目录, the Python version is the system default 2.6,local login Basic Isolation

Python-v

Python 2.6.6


Python Multi-version management tool PYENV installation

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.