Title: Suggest the possible module in ModuleNotFoundError · Issue #134175 · python/cpython · GitHub
Open Graph Title: Suggest the possible module in ModuleNotFoundError · Issue #134175 · python/cpython
X Title: Suggest the possible module in ModuleNotFoundError · Issue #134175 · python/cpython
Description: Feature or enhancement Proposal: When import the module, it will raise ModuleNotFoundError if the word is wrong. Like NameError, we can suggest the module name that might be right. >>>import ant Traceback (most recent call last): File Open Graph Description: Feature or enhancement Proposal: When import the module, it will raise ModuleNotFoundError if the word is wrong. Like NameError, we can suggest the module name that might be right. >>>import ant Tr...
X Description: Feature or enhancement Proposal: When import the module, it will raise ModuleNotFoundError if the word is wrong. Like NameError, we can suggest the module name that might be right. >>>impo...
Opengraph URL: https://github.com/python/cpython/issues/134175
X: @github
Domain: github.com
Links:
Viewport: width=device-width
Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggest the possible module in ModuleNotFoundError","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nWhen import the module, it will raise ModuleNotFoundError if the word is wrong. Like NameError, we can suggest the module name that might be right.\n```pytb\n\u003e\u003e\u003eimport ant\nTraceback (most recent call last):\n File \u003cstdin\u003e line 1, in \u003cmodule\u003e\n import ant\n ^^^\nModuleNotFoundError: no module named 'ant'. Did you mean 'ast'?\n```\nTo get all of the module, this function can get:\n```python\nimport pkgutil\n\ndef get_available_modules():\n return [name for _, name, _ in pkgutil.iter_modules()]\n\navailable_modules = get_available_modules()\n```\nJust need to compare the most likely module name and suggest. \nNote: only when the ModuleNotFoundError was raised by python interpreter instead of __raise__ active\n\n\n### Has this already been discussed elsewhere?\n\nNo response given\n\n### Links to previous discussion of this feature:\n\n_No response_","author":{"url":"https://github.com/Locked-chess-official","@type":"Person","name":"Locked-chess-official"},"datePublished":"2025-05-18T07:57:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":12},"url":"https://github.com/134175/cpython/issues/134175"}
route-pattern /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) route-controller voltron_issues_fragments route-action issue_layout fetch-nonce v2:b0818084-2b77-8794-9720-a04d6eaa3999 current-catalog-service-hash 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 request-id CEDC:3E5E5E:CA7260:10DA1BD:696B8876 html-safe-nonce 429fd025efde8f5a1cdff7dc0a91d56e5f5b643f765d009a05962e81e5f405d0 visitor-payload eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRURDOjNFNUU1RTpDQTcyNjA6MTBEQTFCRDo2OTZCODg3NiIsInZpc2l0b3JfaWQiOiI1MzIzNDI4MjkwODg0MjQxNTI2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= visitor-hmac 56544ff560b51341341450d3e689a5153341e84748444b6882b20de8fe6f1550 hovercard-subject-tag issue:3071529327 github-keyboard-shortcuts repository,issues,copilot google-site-verification Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I octolytics-url https://collector.github.com/github/collect analytics-location / fb:app_id 1401488693436528 apple-itunes-app app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/134175/issue_layout twitter:image https://opengraph.githubassets.com/9e98bcc98d4e35e4ae34d8ba6fca6c9e600e9478e1d1eb88396ad48295219f96/python/cpython/issues/134175 twitter:card summary_large_image og:image https://opengraph.githubassets.com/9e98bcc98d4e35e4ae34d8ba6fca6c9e600e9478e1d1eb88396ad48295219f96/python/cpython/issues/134175 og:image:alt Feature or enhancement Proposal: When import the module, it will raise ModuleNotFoundError if the word is wrong. Like NameError, we can suggest the module name that might be right. >>>import ant Tr... og:image:width 1200 og:image:height 600 og:site_name GitHub og:type object og:author:username Locked-chess-official hostname github.com expected-hostname github.com None 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d turbo-cache-control no-preview go-import github.com/python/cpython git https://github.com/python/cpython.git octolytics-dimension-user_id 1525981 octolytics-dimension-user_login python octolytics-dimension-repository_id 81598961 octolytics-dimension-repository_nwo python/cpython octolytics-dimension-repository_public true octolytics-dimension-repository_is_fork false octolytics-dimension-repository_network_root_id 81598961 octolytics-dimension-repository_network_root_nwo python/cpython turbo-body-classes logged-out env-production page-responsive disable-turbo false browser-stats-url https://api.github.com/_private/browser/stats browser-errors-url https://api.github.com/_private/browser/errors release 82560a55c6b2054555076f46e683151ee28a19bc ui-target full theme-color #1e2327 color-scheme light dark
URLs of crawlers that visited me.