Multi-version coexistence of Python3 and Python2 (Linux)

Source: Internet
Author: User

Python3 has come out some time, Python3 compared to python2 a lot of improvements, including syntax, new features, and optimization. While many libraries support Python2 and Python3 at the same time, some libraries are still not well supported python3, so sometimes we still need to use Python2. Bo Master in the last year to learn Python, as no historical burden of beginners, then naturally selected Python3 to study, but after the installation of the new Python3, the newly installed Python3 inevitably with the system brought about by the python2 of some conflicts. Includes different versions of the call, different versions of the Python Library installation tool (Pip,easy_install). This article explains the coexistence of Python2 and Pyhon3, including the installation of Python3, the installation of Pip, and how to invoke both versions of Python.  How to configure Ubuntu1, installation Python2most Linux distributions come with Python2 and are not installed separately from each other.
sudo Install Python2
2. Install Easy_install for Python2

Install using wget (root privileges may be required)[recommended]

wget https://Bootstrap.pypa.io/ez_setup.py-o-| Python2
or download ez_install.py First, then install
$ python2 ez_install.py
3. Install pip for Python2
$ easy_install-2.7 pip
pip2.7 Install xxx4, installation Python3
sudo Install Python3
5. Install Easy_install for Python3 Install using wget (root privileges may be required) [recommended]
wget https://Bootstrap.pypa.io/ez_setup.py-o-| Python2
or download ez_install.py First, then install
$ python ez_install.py
5. Install pip for Python3
$ easy_install pip
Use

Python2

Python

Easy_install

Pip

Python3

Python3

Easy-install3

Pip3

How to configure ArchLinuxInstalling Python3
sudo pacman-s python
Installing Python2
Sudo
for ArchLinux Easy_install Pip included in the software libraryPython-setuptoolsPython-pipPython2-setuptoolsPython2-pipUse Python2Python2easy_install-2.7pip2.7  Python3pythonEasy-installPip

Multi-version coexistence of Python3 and Python2 (Linux)

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.