The use of coexistence of Python2 and Python3 under Windows __python

Source: Internet
Author: User

Installation Environment:

Windows version: Windows 10 Home Chinese version

Python version 2: Python 2.7.11

Python version 3: Python 3.5.2


1. Install Python

Python official download Address: https://www.python.org/downloads/

Install Python 2 and Python 32 versions of Python, I am installed in different directories in C disk



Double-click to run MSI format file, choose Install PIP and add to environment variable at installation


(Pictures from Liaoche's blog)


2. Invoke different versions of Python

Use the shortcut key win+r to investigate "run" and enter "cmd" to enter the command line tool



Call Python 2 o'clock, use py-2



Call Python 3 o'clock, use py-3



3. Use PIP Installation library

When you install to Python 2 o'clock, you use PIP2 install [name], for example: PIP2 install BS4


When you install to Python 3 o'clock, you use PIP3 install [name], for example: PIP3 install BS4


4. Switch in Pycharm

If you're using Pycharm to write Python, when you need to switch the Python version, just search for "Project interpreter" in the settings, and then switch, and you can see the libraries that are already installed in that version.



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.