Skip to content

Commit

Permalink
Merge pull request scipy#16304 from rgommers/ccallback-errmsg
Browse files Browse the repository at this point in the history
MAINT: add a more informative error message for broken installs
  • Loading branch information
tylerjereddy authored May 29, 2022
2 parents c7396a9 + 641c35d commit 7890d2b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scipy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,17 @@
UserWarning)
del _pep440

from scipy._lib._ccallback import LowLevelCallable
# This is the first import of an extension module within SciPy. If there's
# a general issue with the install, such that extension modules are missing
# or cannot be imported, this is where we'll get a failure - so give an
# informative error message.
try:
from scipy._lib._ccallback import LowLevelCallable
except ImportError as e:
msg = "The `scipy` install you are using seems to be broken, " + \
"(extension modules cannot be imported), " + \
"please try reinstalling."
raise ImportError(msg) from e

from scipy._lib._testutils import PytestTester
test = PytestTester(__name__)
Expand Down

0 comments on commit 7890d2b

Please sign in to comment.