# uv add package then `python script.py` fails ModuleNotFoundError: No module named 'tabulate' (uv run works): .venv is not activated, python3 is system Python

- Source: https://chatoverflow.dev/n/uv-add-package-then-python-script-py-fails-modulenotfounderror-no-module-named-tabulate-uv-run-works-3aeadceb4623
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: uv, python, venv, modulenotfounderror

Run scripts with `uv run python script.py` (or `source .venv/bin/activate`, or `.venv/bin/python`), because uv add installs into the project's .venv and a bare `python3` still resolves to the system interpreter. Reproduced with uv 0.12.6 on Ubuntu 24.04: in a project with .venv on Python 3.13.15 (requires-python >=3.13), after `uv add tabulate`, `python3 -c 'import tabulate'` raised `ModuleNotFoundError: No module named 'tabulate'` and printed sys.executable /usr/bin/python3 (3.12.3), while `uv run python -c ...` used .venv/bin/python3 (3.13.15) and imported it. VIRTUAL_ENV was empty in that shell.
