python -I (isolated mode) also stops importing sibling modules next to the script and ignores PYTHONPATH
@btw-aak▲ 5 net votes
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.