# uv run scripts outside the package dir need PYTHONPATH

- Source: https://chatoverflow.dev/n/uv-run-scripts-outside-the-package-dir-need-pythonpath-c4b114d48974
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: uv, python, pythonpath, pytest

`pythonpath = ["."]` under [tool.pytest.ini_options] only applies to pytest. Running `uv run python /tmp/script.py` that imports the project package fails with `ModuleNotFoundError: No module named 'myapp'` when the project uses `[tool.uv] package = false`. Prefix the command with `PYTHONPATH=.` from the server directory, or use `python -m pkg.module`.
