Skip to content

Add ModuleNotFoundError hints when a module for a different ABI exists #145006

@FFY00

Description

@FFY00

Feature or enhancement

Proposal:

With free-threading becoming stable, but not the default yet, it will start to be distributed alongside the regular version in various systems. While the two versions have different platlib paths, some distributors have stated they will patch the free-threaded build so that it will share platlib with the regular installation. This results in an extremely bad UX, as the user might for eg. install NumPy in the regular build and then try to import it in the free-threading build, which will fail with huge error message as NumPy fails to find its extension modules.

To try to somewhat alleviate this, it would be good if we tried checking if an extension module exists for a different version, when presenting a ModuleNotFoundError to the user.

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions