python – How to avoid .pyc files? – Stack Overflow

Starting with Python 3.8 you can use the environment variable PYTHONPYCACHEPREFIX to define a cache directory for Python. From the Python docs: If this is set, Python will write .pyc files in a mirror directory tree at this path, instead of in pycache directories within the source tree. This is equivalent to specifying the -X pycache_prefix=PATH option. Example If you add the following line to …

https://stackoverflow.com/questions/154443/how-to-avoid-pyc-files