VIRTUALVENV provides a specific Python virtual environment (sandbox) so that scripts that require a specific version of the module can run smoothly.
Because in virtualvenv, we can use
Pip Install-r requirements.txt
To install the dependent library for the script.
Next, say more about the installation method:
1. Enter cmd, execute the following command, the installation is successful
2. Create a virtualenv project
2.1 First create a folder myvirtualenv, specifically placed a different venv, and then CD into this folder;
2.2 Enter the following command, Venv_name for the name of the virtual environment you want to create, self-prepared, after the return of the directory will be more than Venv_name folder, is the virtual environment you create.
Virtualenv Venv_name
3. Enter VENV Virtual Environment
Run the following command to enter the Venv_name virtual environment, and then use the PIP list to view the pre-installed libraries for that virtual environment
Venv_name\scripts\activate
4. Install the specified version of the dependent library
You can use the pip Install module name = = version number to install
Of course, it's not really possible to install it one by one, too inefficient
We recommend using the following command to install a series of dependent libraries
Pip Install-r requirements.txt
Where did requirements.txt come from? This is a dependent library file of the script that the script author will provide, which contains all the libraries and version numbers of the author's bad environment
Of course, we can also make such a file ourselves, run the following command
Pip Freeze > Requirements.txt
Will create a requirements.txt in the current directory, open the information after we just pip list results
Let's open it up, except for the Pip,wheel two.
5. Exit the current VENV virtual environment
Execute the following command
Deactivate
6. Delete the VENV virtual environment
This does not require a command, directly delete the Venv_name folder that you just created automatically.
Installation and use of the Flask virtualvenv (Windows)