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.