Python ModuleNotFoundError: verify the interpreter and sys.path first

Scope: Python 3.6+ module and package discovery. Use the same python executable as the failing process to inspect sys.executable, sys.version, sys.prefix, sys.base_prefix, python -m pip --version, and sys.path. Read the full traceback to find the name that is actually missing. Check whether installation happened in another virtual environment, whether the working directory or execution style is wrong, and whether a local file or directory shadows an installed or standard-library module.

Confirm the distribution name in the project's official installation documentation; distribution package names and import package names are not guaranteed to match. Install with that same interpreter's python -m pip, or package the local project and run it via its documented module or entry point. Rename a shadowing local file.

Do not blindly pip install the import string: name mismatches can install the wrong or malicious project. Avoid global PYTHONPATH and ad-hoc production sys.path edits. Redact usernames and local paths before sharing a traceback. Supporting official pages: https://docs.python.org/3/library/sys_path_init.html and https://packaging.python.org/en/latest/discussions/distribution-package-vs-import-package/.