CENTOS6 pyenv and virtualenv to build a python virtual environment

Source: Internet
Author: User
Tags virtual environment virtualenv

Installing Pyenv
    • Basic Environment Package Installation
Yum-y install gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel Bzip2-libsyum I Nstall-y net-tools vim lrzsz tree screen lsof tcpdump nmap sysstat Dos2unix
    • Select Install to $home/.pyenv directory
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
    • Configuring Environment variables
echo ' Export pyenv_root= ' $HOME/.pyenv "' >> ~/.bashrcecho ' export path=" $PYENV _root/bin: $PATH "' >> ~/. Bashrc
    • Add pyenv Initialize to Shell
Echo ' eval ' $ (pyenv init-) "' >> ~/.BASHRC
    • Restart the shell for changes to take effect
EXEC $SHELLsource ~/.BASHRC
    • Install the specified version of Python
Pyenv Install--listpyenv Install 2.7.13
    • Uninstalling the specified version
Pyenv Uninstall 2.7.13
    • Global switch to Python 2.7. Version 13
Pyenv Global 2.7.13
    • Switch Python 2.7. Version 13 for the current directory and its subdirectories only
Pyenv Local 2.7.13
    • View current usage version
    • View all installed Versions
Pyenv versions

. Pyenv-virtualenv plug-in installation
    • Package Installation
git clone https://github.com/yyuu/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv  
    • Configuring Environment variables
Echo ' eval ' $ (pyenv virtualenv-init-) "' >> ~/.bashrcsource ~/.BASHRC

virtualenv Creating and using a virtual Python environment
    • Create a virtual Python environment
Pyenv virtualenv 2.7.13 Testvir
    • Switch and use a new Python virtual environment
Pyenv Activate Testvir
    • Switch back to the system environment
Pyenv Deactivate
    • Deleting a virtual environment
Pyenv Virtualenv-delete Testvir

CENTOS6 pyenv and virtualenv to build a python virtual environment

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.