how_to_do_requirements.md 1015 B

I plan to mantain two different requirements files:

  1. Using freeze from the activated venv: pip freeze > requirements_freezed.txt

  2. Using pipreqs, pointing to the flask_be folder: pipreqs {gitDir}/flask_be

The reasons:

  • pip freeze saves the packages that are installed with pip install in your environment, while pipreqs saves the packages that are imported in the workspace
  • pip freeze saves all packages in the environment (global or venv) including those that you don’t use in your current project and doesn't save packages which are not installed even if the project does need them
  • pip freeze saves the EXACT (==) version of the packages installed; this is sometimes annoying, but makes for better reproducibility. pipreqs will deduce the dependencies from the imported packages, which typically implies they will >= a given version.

Both files should be able to get the app running.

I recommend registering the version of Python, pip and pipreqs in the requirements files too.