ModuleNotFoundError: No module named '…'

Python can't find a package that's installed in a different environment than the one currently running.

Common causes

  • Virtual environment not activated
  • Package installed with the wrong pip/python pairing

Diagnostic commands

bash
$ which python
$ which pip

Solutions

  • Activate the correct virtual environment before installing or running
  • Reinstall the package inside the active environment

Related tutorials