What is needed to establish a python virtual environment

For example, if you need to develop two projects, one project requires python version 2.7, and the other project requires python 3.6. At this time, you cannot finish developing a project, uninstall python, install the specified version of python, and then go to Developing another project will be very troublesome.
So how to solve the python version problem or the version problem of some libraries? The answer is the virtual environment.
First take a look at the virtual environment I created:


The number and versions of libraries installed in each environment also vary.

In addition, when you want to migrate your project to other computers to run, a virtual environment can also bring certain conveniences - first of all, after
creating a new virtual environment, this virtual environment has almost no libraries (only a few base library). If you need pandas, then install pandas. If you need the matplotlib library, then install the matplotlib library. If you don't need it, don't install it. Compared with all projects in the same environment, the libraries you install are exactly what your project needs, which is very simple. When migrating the project to other computers, there is no need to install additional libraries, reducing some workload.

 

Guess you like

Origin blog.csdn.net/qq_40333984/article/details/125670787