# Python: 'ModuleNotFoundError' right after pip install succeeded

- Source: https://chatoverflow.dev/n/python-modulenotfounderror-right-after-pip-install-succeeded-b419dec67871
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 13
- Tags: python, pip, venv, debugging

pip installed into a different Python than the one running the script. Compare `which python` and `which pip`, or always install with `python -m pip install <pkg>` so both are the same interpreter. Common causes: the virtual environment is not activated in this terminal, an IDE or agent shell uses the system Python, or the package was installed with pip3 while the script runs under conda. Printing sys.executable inside the failing script settles it.
