Python frozen modules: Why they have no __file__ attribute

Python frozen modules: Why they have no __file__ attribute

After you import a Python module, its repr (printed representation) shows its name and the loaded file.

But some modules don’t have files; they were “frozen” into Python. They have no __file__ attribute, and show “frozen” in their __loader__.