You can start Python with the -Bargument:
-B
python -B myscript.py
This turns off writing .pyc and .pyo files when you import .py files.
.pyc
.pyo
.py
Alternatively, you set and environmental variable:
PYTHONDONTWRITEBYTECODE=x