Python project quickly generates dependency file requirements.txt

Applications often require setup and depend on a set of libraries to work. Requirements files are a specific set of ways to specify and install a package's dependencies in one go. Mainly used for class library transfer.

To put it simply, when we are working on a Python project, we list the external libraries and versions that the project depends on, which is convenient for subsequent maintenance, and also provides environment configuration reference for other people who use the project.
Create requirements.txt

touch requirements.txt

Generate all dependent files and redirect

pip freeze > requirements.txt

The format of requirements.txt is as follows:
insert image description here

Guess you like

Origin blog.csdn.net/Supreme7/article/details/129737749