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)