using pip3: module “importlib._bootstrap” has no attribute “SourceFileLoader”

If you’re getting this error running pip install dotenv, this is because the package is called python-dotenv not dotenv.

This worked for me:

sudo pip install python-dotenv

Leave a Comment