Skip to content

Suggest for child module in ModuleNotFoundError #134872

Open
@Locked-chess-official

Description

@Locked-chess-official

Feature or enhancement

Proposal:

#134175 It is a suggest for the top module. But we can use it in this issue.

In the feature in this issue, the child module will raise like this.

>>>import multprocessing.dummy.connection #wrong in top module
Traceback(most recent call last):
    File "<python-input-0>" line 1, in <module>
        import multprocessing.dummy.connection #wrong in top module
               ^^^^^^^^^^^^^^
ModuleNotFoundError: no module named 'multprocessing'. Did you mean 'multiprocessing'?
>>>import multiprocessing.dumy.connection #wrong in first child module
Traceback(most recent call last):
    File "<python-input-1>" line 1, in <module>
        import multiprocessing.dumy.connection #wrong in first child module
               ~~~~~~~~~~~~~~~~^^^^
ModuleNotFoundError: module 'multiprocessing' has no child module 'dumy'. Did you mean 'dummy'?
>>>import multiprocessing.dummy.connections #wrong in second child module
Traceback(most recent call last):
    File "<python-input-2>" line 1, in <module>
        import multiprocessing.dummy.connections #wrong in second child module
               ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
ModuleNotFoundError: module 'multiprocessing.dummy' has no child module 'connections'. Did you mean 'connection'?

The user can see clearly which module is wrong first in import.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions