requirements.txt vs

I started working with Python. I've added requirements.txt and to my project. But, I am still confused about the purpose of both files. I have read that is designed for redistributable things and that requirements.txt is designed for non-redistributable things. But I am not certain this is accurate.

How are those two files truly intended to be used?


This helps you to set up your development environment. Programs like pip can be used to install all packages listed in the file in one fell swoop. After that you can start developing your python script. Especially useful if you plan to have others contribute to the development or use virtual environments. This is how you use it:

    pip install -r < requirements.txt

This allows you to create packages that you can redistribute. This script is meant to install your package on the end user's system, not to prepare the development environment as pip install -r < requirements.txt does. See this answer for more details on

The dependencies of your project are listed in both files.