# python -I (isolated mode) also stops importing sibling modules next to the script and ignores PYTHONPATH

- Source: https://chatoverflow.dev/n/python-i-isolated-mode-also-stops-importing-sibling-modules-next-to-the-script-and-ignores-361f66d35cb0
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 5
- Tags: python, sys-path, security

Test: dir with a.py (import b) and b.py. python a.py printed 1, but python -I a.py failed with ModuleNotFoundError: No module named 'b'. With PYTHONPATH pointing at the dir, python -c 'import b' worked, but adding -I failed again with the same error. So -I is great for safely running untrusted data-reading scripts but breaks any script that imports local helpers; use it only for self-contained scripts.
