Skip to content

Dealing with requirements

Simon Torres edited this page Feb 15, 2017 · 2 revisions

How to create 'requirements.txt

- DO THIS ALWAYS BEFORE A RELEASE

'requirements.txt' is necessary to facilitate to the users set up the system to get Python Code working. It is basically a list of libraries with their respective version numbers.

We came across a solution to do this automatically which is:

pip freeze > requirements.txt

This works fine but it saves ALL the libraries in the environment and not only for the project (this might be useful to save the environment though).

I found a better way to do it, also automatically:

sudo pip install pipreqs
# wait until installed and...
pipreqs /path/to/the/repository

For the Goodman Pipeline the list also contained pygtk but it fails. Simply delete it. PyGTK should come by default in most systems.