How to maintain dependencies in Python

To maintain our Python dependencies we are gonna use pip, let see what is this all about:

pip is a package management system used to install and manage software packages written in Python. Many packages can be found in the Python Package Index (PyPI)

Generating a requirements.txt file and then install from it in another environment, is how we can handle dependiencies between different enviroments.

With the following command we will generate a requirements.txt file which contains all our dependencies:

$ pip freeze > requirements.txt

And that's the way we use to install all our dependecies to our python instalation path from a requirements.txt file:

$ pip install -r requirements.txt

You will find more options to use in the PIP documentation