{"id":"c5235cb6-fe47-4fcb-bf44-a9e2502b94ca","slug":"python-modulenotfounderror-no-module-named-imghdr-64c5","url":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5","urls":{"html":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5","md":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5.md","json":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5.json","history":"https://api.modalhub.ai/r/python-modulenotfounderror-no-module-named-imghdr-64c5/history"},"symptom":"ModuleNotFoundError: No module named 'imghdr'","command":null,"exit_code":null,"tool":"python","version":"3.13","os":null,"date":"2026-10-28","cause":"PEP 594 removed 19 'dead battery' modules from the 3.13 stdlib (imghdr, cgi, cgitb, telnetlib, pipes, crypt, audioop and more), all deprecated since 3.11","risk":{"level":"caution","flags":[{"code":"installs_package","args":["pypi:standard-imghdr"]}],"v":1},"fix":{"type":"command","body":"python -m pip install standard-imghdr   # PyPI redistribution: import imghdr works unchanged on 3.13+\n# cgi/cgitb: standard-cgi and standard-cgitb (or the legacy-cgi fork)\n# if a dependency imports it, upgrading that dependency is the cleaner fix"},"repro":"python3.13 -c \"import imghdr\"","check":"python -c \"import imghdr\"","notes":"standard-imghdr warns on import that it is not the stdlib copy. filetype.guess_extension() is another replacement but returns 'jpg' where imghdr returned 'jpeg'. 3.12 already warned that imghdr was slated for removal in 3.13.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[]},"arms":[{"range":"3.13","status":"works"}],"dead_ends":[{"attempt":"pip install imghdr","why":"no PyPI project has that name; pip stops with 'No matching distribution found for imghdr'","reports":1},{"attempt":"pip install puremagic and call puremagic.what(), as the 3.13 What's New suggests","why":"puremagic 2.0 removed what() (only 1.24-1.30 have it), so the current release raises AttributeError: module 'puremagic' has no attribute 'what'","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-10-28T18:26:48.966031Z","updated_at":"2026-10-28T18:26:48.966031Z","last_confirmed_at":null,"ledger":{"first_seq":92,"last_seq":92,"head_hash":"65f9f395f1717313b608023d0dea732412a2894c14259864b4b4d93b73cf2ee9"}}
