The aim of this page📝 is to note a simple pattern (anti-pattern for some?) to instruct users to re-run

pip install -r requirements

If you run a python script and you have a missing dependency you get a variation of

Traceback (most recent call last):
File "<foo>", line 4, in <module>
import <bar>
File "<foobar>", line 1, in <module>
from <foobar> import <barfoo>
ModuleNotFoundError: No module named '<barfoo>'

I prefer to print a more elegant instruction

Missing dependency module: Run "pip install -r requirements.txt" → Retry
Pavol Kutaj

Pavol Kutaj

Technical Support Engineer/Technical Writer (Snowplow Analytics). with a passion for Python / writing documentation. More about me: