Detailed usage of Python virtual environment venv

**Original intention: **

When we are working, we will have many projects, and each project uses a different version of the library, which makes it very troublesome for us to switch projects.

For example: I have two django projects, the version used in the first project is django 1.7, and the version used in the second project is django 2.2. Both projects are usually maintained. If there is no independent environment, then every time I maintain project one, I need to install django 1.7. When maintaining project two, I need to install django 2.2, which will be very troublesome.

Therefore, we need to establish an independent environment for each project. At this time, environmental management comes in handy. When I maintain project 1, I only need to use the environment of project 1 to run the project, and I don’t need to uninstall it. Install the specified django version.

Environmental management tools: venv

**Installation method: **

After Python 3.3, comes with the library.

Instructions:

  1. Create a new environment in the specified folder

python -m venv [environment name]

  1. Enter the created project

  1. Exit the environment

test\scripts\deactivate.bat

The above is the whole content of this article, I hope it will be helpful to everyone's study.

Recommended Posts

Detailed usage of Python virtual environment venv
Detailed usage of dictionary in Python
Python virtual environment: Ubuntu16.04
Ubuntu20.04 install Python3 virtual environment tutorial detailed explanation
Detailed explanation of the usage of Python decimal module
Detailed explanation of Python web page parser usage examples
Centos7 deploys python3 virtual environment
The usage of wheel in python
Detailed explanation of python backtracking template
Analysis of usage examples of Python yield
Detailed implementation of Python plug-in mechanism
Detailed explanation of python sequence types
Usage of os package in python
Install Python virtual environment on Ubuntu 18.04
Simple usage of python definition class
[python] python virtual environment construction & GPU environment
The usage of tuples in python
The usage of Ajax in Python3 crawler
Detailed explanation of Python IO port multiplexing
Detailed analysis of Python garbage collection mechanism
Detailed explanation of -u parameter of python command
Detailed explanation of Python guessing algorithm problems
Detailed explanation of the principle of Python super() method
7 features of Python3.9
Detailed explanation of python standard library OS module
Python3 development environment to build a detailed tutorial
The meaning and usage of lists in python
Detailed explanation of how python supports concurrent methods
Detailed explanation of data types based on Python
Detailed explanation of building Hadoop environment on CentOS 6.5
Detailed examples of using Python to calculate KS
Python: Virtual Environment-Ubuntu16.04
Detailed explanation of Centos 7 system virtual machine bridging mode
Detailed explanation of the principle of Python function parameter classification
Detailed explanation of the principle of Python timer thread pool
Detailed explanation of the implementation steps of Python interface development
Detailed explanation of common tools for Python process control
Detailed explanation of the attribute access process of Python objects
Detailed explanation of the remaining problem based on python (%)
Detailed installation steps of CentOS6.4 system in virtual machine
How to create a Python virtual environment in Ubuntu 14.04
Python3 built-in module usage
Detailed Python IO programming
Detailed Python loop nesting
Basics of Python syntax
Python advanced usage summary
Basic syntax of Python
Prettytable module of python
MongoDB usage in Python
09. Common modules of Python3
Summary of ubuntu usage
Encountered in the process of building a virtual environment in ubuntu
Detailed steps for installing Django under Python 3.6 in Ubuntu 16.04 environment