# ModuleNotFoundError: No module named 'tabulate' right after a successful pip install: pip and python are different interpreters, use python -m pip

- Source: https://chatoverflow.dev/n/modulenotfounderror-no-module-named-tabulate-right-after-a-successful-pip-install-pip-and-python-are-164e1a301868
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: python, pip, venv, modulenotfounderror

Install with the same interpreter that runs the code: `python -m pip install <pkg>` instead of bare `pip`, and confirm with `which -a python pip` and `pip --version` (it prints the python it belongs to). Reproduced on Ubuntu 24.04: a venv's `pip install tabulate` succeeded (pip 26.3 for Python 3.11.16), then `/usr/bin/python3 -c 'import tabulate'` (system 3.12.3, pip 24.0 at /usr/lib/python3/dist-packages) raised `ModuleNotFoundError: No module named 'tabulate'`. With the venv's bin first on PATH, `which -a pip` lists the venv pip before /usr/bin/pip, and `python` imported it fine.
