GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-134872: add ModuleNotFoundError suggestions by FFY00 · Pull Request #142512 · python/cpython

Conversation

@FFY00

@FFY00 FFY00 commented Dec 10, 2025 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Needs GH-139900

  • Issue: Add import suggestions for ModuleNotFoundError #134872

📚 Documentation preview 📚: https://cpython-previews--142512.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot mentioned this pull request Dec 10, 2025
Add import suggestions for ModuleNotFoundError #134872
Closed
@FFY00

FFY00 commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

@Locked-chess-official, this draft PR includes the changes from GH-139900, introducing the .discover() method, and my initial proposed traceback implementation.

I think it should address the concerns you raised in GH-139899, could you give it a look?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@FFY00

FFY00 commented Dec 10, 2025

Copy link
Copy Markdown
Member Author

Right now it doesn't special-case relative imports, but the message is still helpful.

Python 3.15.0a2+ free-threading build (heads/gh-139899:6816705de0c, Dec 10 2025, 12:54:51) [GCC 15.2.1 20251112] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aa
Traceback (most recent call last):
  File "<python-input-0>", line 1, in <module>
    import aa
  File "/home/anubis/git/cpython/test-cases/aa/__init__.py", line 1, in <module>
    from .bb import *
ModuleNotFoundError: No module named 'aa.bb'. Did you mean: 'aa.bbb'?

I think it should be alright for an initial implementation, and then we can improve — just trying to make the scope smaller to hopefully guarantee this proposal doesn't lose momentum and ends up stalled.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@FFY00
FFY00 force-pushed the ModuleNotFoundError-suggestions branch from 3ef83d6 to 889c7ce Compare December 10, 2025 13:13
@FFY00
FFY00 force-pushed the ModuleNotFoundError-suggestions branch from 889c7ce to c98677f Compare February 19, 2026 15:27
@FFY00
FFY00 marked this pull request as ready for review February 19, 2026 15:33
@bedevere-app bedevere-app Bot added the awaiting core review label Feb 19, 2026
@FFY00
pythongh-134872: Add traceback suggestions for ModuleNotFoundError
c739aa6
Signed-off-by: Filipe Laíns <[email protected]>
@FFY00
FFY00 force-pushed the ModuleNotFoundError-suggestions branch from c98677f to c739aa6 Compare February 19, 2026 15:40
@FFY00
Add news
fb57d7d
Signed-off-by: Filipe Laíns <[email protected]>
@FFY00
FFY00 enabled auto-merge (squash) February 19, 2026 15:42
@FFY00
FFY00 merged commit f282f7a into python:main Feb 19, 2026
47 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Feb 19, 2026
@Locked-chess-official Locked-chess-official mentioned this pull request Feb 20, 2026
Suggest the possible module in "python -m module" #145031
Open
brijkapadia pushed a commit to brijkapadia/cpython that referenced this pull request Feb 28, 2026
@FFY00 @brijkapadia
pythonGH-134872: add ModuleNotFoundError suggestions (python#142512)
863dbc2
* pythongh-134872: Add traceback suggestions for ModuleNotFoundError

Signed-off-by: Filipe Laíns <[email protected]>

* Add news

Signed-off-by: Filipe Laíns <[email protected]>

---------

Signed-off-by: Filipe Laíns <[email protected]>
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@FFY00 @ljfp
pythonGH-134872: add ModuleNotFoundError suggestions (python#142512)
634cdd7
* pythongh-134872: Add traceback suggestions for ModuleNotFoundError

Signed-off-by: Filipe Laíns <[email protected]>

* Add news

Signed-off-by: Filipe Laíns <[email protected]>

---------

Signed-off-by: Filipe Laíns <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@FFY00
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.