Why Install virtualenv?
Creating a separate virtual environment for each program ensures that the program can only access packages in the virtual environment, keeping the global interpreter clean and concise.
CAST:
1. Installing virtualenv
2. Installing a virtual environment for a project
You first create the project folder New_porject, open the file,
Install Virtual Environment env, execute: virtualenv env
3. Start the virtual environment to install the required library 3.1 for the project to start the virtual environment
To start the virtual environment, use the command: your_env_dir\scripts\activate,
After activating the virtual environment, a <env> appears in front of the command in the CMD window, indicating that it is currently in a virtual environment.
3.2 Installing the class library in a virtual environment
By default, VIRTUALENV has been installed with PIP.
You can install the class library for the virtual environment by using the PIP Install command directly after you start the virtual environment:
4. Using the configured VIRTUALENV environment in Pycharm
Open setting Add local python environment:
Select the virtual environment you just created:
VIRTUALENV installation and use on Windows