Open
Description
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?