Skip to content

Suggest the possible module in "python -m module" #145031

Open

Description

@Locked-chess-official

Feature or enhancement

Proposal:

Now python has suggested the possible module name when ModuleNotFoundError raised. This issue is trying to make it also enable in "python -m module". The effect is like:

❯ python -m randon
/Library/Frameworks/Python.framework/Versions/3.14/bin/python3: No module named 'randon'. Did you mean: 'random'?

Changing "runpy.py" can make it.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added
    stdlibStandard Library Python modules in the Lib/ directory
    on Feb 20, 2026
  2. sharktide commented on Feb 20, 2026

    @sharktide
    Contributor

    If no other information is given (eg. someone just types python -m module, how can we reliably determine the module they are looking for? Or do we just print out all the modules to stdout

  3. Locked-chess-official commented on Feb 20, 2026

    @Locked-chess-official
    ContributorAuthor

    If no other information is given (eg. someone just types python -m module, how can we reliably determine the module they are looking for? Or do we just print out all the modules to stdout

    There is no needed to do that. Just using the way like #142512. Only one possible module will be printed in stderr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-importlibtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions