How to run a Python project using __pycache__ folder?
问题 I want to run a Pythonic project using Python compilation ( .pyc or __pycache__ ). In order to do that in Python2 , I haven't any problem. Here is a simplified example in a Python2 project: Project tree: test2 ├── main.py └── subfolder ├── __init__.py └── sub.py Compile: python -m compileall test2 Project tree after the compile: test2 ├── main.py ├── main.pyc └── subfolder ├── __init__.py ├── __init__.pyc ├── sub.py └── sub.pyc As you can see, several .pyc manually generated. Now I can run