Skip to content

detect ModuleNotFoundError in pyimport #645

Open
@stevengj

Description

@stevengj

Currently, we print The Python package foo could not be found by pyimport when any ImportError is thrown by pyimport. We should only print this on a ModuleNotFoundError, as otherwise it is misleading.

Note that we can only do this in Python ≥ 3.6 (python/cpython@c943265). I guess in earlier versions we could check for "No module named" in the ImportError string?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions