Pyenv build Python Multiple versions coexist environment

Source: Internet
Author: User
Tags rehash

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

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.