Installing the PYENV Environment yum-y install Gityum install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip 2-develuseradd pythonpasswd python# su-python$ curl-l https://raw.githubusercontent.com/pyenv/pyenv-installer/ Master/bin/pyenv-installer | Bashpath= $PATH: $HOME/binvim ~/.BASHRC Add the following three lines of export path= "/home/python/.pyenv/bin: $PATH" eval "$ (pyenv init-)" eval "$ ( Pyenv Virtualenv-init-) "$ source ~/.bashrcpython--versionpyenv python-vpyenv versionspyenv help installpyenv install 3. 5.3pyenv Install 3.5.3-v$ mkdir ~/.pyenv/cache The downloaded package is put in, three kinds of compression format are put in the $ pyenv versions* system (set by/home/python/.pyenv/v ersion) 3.5.3[[email protected] ~]$ pyenv pyenv 1.1.3usage:pyenv <command> [<args>]some useful Pyenv Co Mmands are:commands List all available pyenv commands local Set or show the local application-specific Pytho N version. The current folder is bundled with the version environment, and subdirectories inherit global Set or show the global Python version. Change Global version Shell Set oR show the Shell-specific python version only changes the current shell versions of install install a Python version using Python-bu ILD Uninstall Uninstall a specific Python version rehash rehash pyenv shims (run this after installing Executab Les) version Show the current Python version and its origin versions List all Python versions available to Pyen V which Display the full path to a executable whence List all Python versions that contain the given EXECU Tablesee ' pyenv help <command> ' For information on a specific command.$ mkdir py3.5.3cd py3.5.3[[email protecte D] ~]$ pyenv Versionsystem (set by/home/python/.pyenv/version) [[email protected] ~]$ pyenv versions* System (set by /home/python/.pyenv/version) 3.5.3 subdirectory inheritance will also save the downloaded compressed package in the cache directory [[email protected]. pyenv]$ pyenv Install 3.6.2-v[[ Email protected]. pyenv]$ ls/home/python/.pyenv/cache/python-3.6.2.tar.gz[[email protected] cmdb]$ pyenv versions* System (Set By/home/python/.pyenv/version) 3.5.3 3.6.1 3.6.2[[email protected] cmdb]$ pyenv virtualenv 3.5.3 magedu353. Multi-person collaborative development uses virtual environments to avoid common directory Envs confusion requirement already satisfied:setuptools in/home/python/.pyenv/versions/3.5.3/envs/ Magedu353/lib/python3.5/site-packagesrequirement already Satisfied:pip in/home/python/.pyenv/versions/3.5.3/envs/ Magedu353/lib/python3.5/site-packages[[email protected] cmdb]$ pyenv versionsystem (set by/home/python/.pyenv/ Version) [[email protected] cmdb]$ pyenv versions* System (set by/home/python/.pyenv/version) 3.5.3 3.5.3/envs/mag edu353 3.6.1 3.6.2 magedu353[[email protected] cmdb]$ pyenv local magedu353 (magedu353) [[email protected] cmd b]$ pyenv versionmagedu353 (set by/home/python/magedu/project/cmdb/.python-version) (magedu353) [[email Protected] cmdb]$ pyenv versions system 3.5.3 3.5.3/envs/magedu353 3.6.1 3.6.2* magedu353 (set by/home/python/magedu /project/cmdb/.python-version) (magedu353) [[email protected] cmdb]$
pyenv Configuring a Python virtual environment