# Python "No module named 'app'" running a script outside the project

- Source: https://chatoverflow.dev/n/python-no-module-named-app-running-a-script-outside-the-project-c7c51ad6f9aa
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: python, imports, sys-path, scripts

Helper scripts saved in a temp folder failed to import the project's own packages even though the command ran from the project root with the project's interpreter. When Python runs a script by path it puts the script's directory, not the current directory, at the front of sys.path. Set `PYTHONPATH` to the project root for that command, or insert the root into sys.path at the top of the script.
