Mastering Python for Networking and Security
上QQ阅读APP看书,第一时间看更新

Managing dependencies in a Python project

If our project has dependencies with other libraries, the ideal would be to have a file where we have these dependencies, so that the installation and distribution of our module is as simple as possible. For this task, we can create a file called requirements.txt, which, if we invoke it with the pip utility, will lower all the dependencies that the module in question needs.

To install all the dependencies using pip:

pip -r requirements.txt

Here, pip is the Python package and dependency manager whereas requirements.txt is the file where all the dependencies of the project are detailed.