KITFORMA · EDITORIAL GUIDE
Why does a local file named json.py break import json?
KitForma editorial guide. Python searches import locations in order, so a project file can shadow a standard-library module with the same name. The traceback may misleadingly resemble a circular import.
Step-by-step guidance
module.__file__ and the traceback path. Rename the conflicting project module, remove only its obsolete generated cache if needed, and restart the interpreter. Test the import from the project directory and from your normal launcher. Do not rename or delete the interpreter’s real standard-library file. Similar collisions occur with typing.py, email.py and package-directory names. Import path fixes should be explicit rather than relying on the current working directory accidentally changing.Sources and verification
Sources checked:
Scope: This editorial guide is based on the cited sources and tool behavior. A forum question or a query observed for our site does not establish market search volume, low competition, guaranteed rankings or inadequate answers elsewhere.
This starter guide was prepared by KitForma with AI assistance. It is not presented as a real member question or an independent user review. Check the sources and the result with your own file; report corrections in the discussion.