Python multi-version management--pyenv

Source: Internet
Author: User
Tags using git git clone

Python Multi-version management Installing a dependent library in a Python build

Yum install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel

Pyenv install using git to download pyenv to your home directory

git clone https://github.com/yyuu/pyenv.git ~/.pyenv

Then you need to modify the environment variables, using the Bash Shell's input

$ Echo ' Export pyenv_root= ' $HOME/.pyenv "' >> ~/.bash_profile

$ Echo ' Export path= ' $PYENV _root/bin: $PATH "' >> ~/.bash_profile

Finally add pyenv init

Echo-e ' If command-v pyenv 1>/dev/null 2>&1; then\n eval "$ (pyenv init-)" \nfi ' >> ~/.bash_profile

Enter the command to restart the shell, and then you can restart the pyenv

EXEC $SHELL
SOURCE ~/.bash_profile

Use view to install Python version

Pyenv install-list or (-l)

Install new Python version

Pyenv Install 3.6.5

Pyenv Install 2.7.14

View installed Python versions

Pyenv versions

Switch versions

Pyenv Local 3.6.5

Pyenv Local 2.7.14

Uninstalling the Python version

Pyenv Uninstall 3.6.5

Pyenv Uninstall 2.7.14

Using the PIP tool

Python-m pip xxxxx

Python multi-version management--pyenv

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.