1. Preface
Sometimes multiple versions of Python want to use pyenv isolation to avoid interference between different versions of the repository. Using pyenv can solve the problem of the development and use of python2 and Python3 very well.
2.pynev Dependent library files
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel Libpcap-devel Xz-devel
3. Installing pyenv
mkdir ~/. pyenv git clone git://github.com/yyuu/pyenv.git ~/. pyenv 'Export pyenv_root= "$HOME/.pyenv" >> ~/bashrc 'export path= ' $PYENV _root/ Bin: $PATH "' >> ~/. BASHRC 'eval" $ (pyenv init-) "' >> ~/. BASHRC exec
4. View the installable version
Pyenv Install--list
5. Start the installation of python3.6.3
Start installing python3.6.3 pyenv Install-v 3.6.3 to view the versions that are included in the current system. * Indicates the version currently in use [[email protected] bin]# pyenv versions * System (set by/root/. pyenv/version) 3.6.3
6. Switch versions
Remember to change the version after: pyenv rehash Global 3.6.3 [[email protected] bin]$ pyenv versions system* 3.6.3 (set by/root/.pyenv /version) [[email protected] bin]$ pyenv rehash
7. Install Python package management tool PIP 1. First install Setuptools
wget--no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz #md5=c607dd118eae682c44ed146367a17e26-zxvf setuptools-19.6. TAR.GZCD setuptools- 19.6. Tar.gzpython3 setup.py buildpython3 setup.py Install
2. Install Pip
wget--no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz#MD5 =3a73c4188f8dbad6a1e6f6d44d117eeb-zxvf pip-8.0.2. TAR.GZCD pip-8.0.2python3 setup.py Buildpython3 setup.py Install
Pyenv build Python Multiple versions coexist environment