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
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