Skip to content

Commit

Permalink
Merge pull request #181 from mattwthompson/loud-importerror
Browse files Browse the repository at this point in the history
Re-raise exception when NumPy/SciPy imports fail
  • Loading branch information
leeping committed Jun 9, 2020
2 parents 867de5e + e943626 commit 743a7d6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
try:
import numpy
import scipy
except ImportError:
print("Error importing numpy and scipy but these are required to install ForceBalance")
print("Please make sure the numpy and scipy modules are installed and try again")
exit()

except ImportError as e:
msg = ("\n"
"Error importing numpy and scipy but these are required to install ForceBalance.\n"
"Please make sure the numpy and scipy modules are installed and try again.\n"
)
raise ImportError(msg)

#===================================#
#| ForceBalance version number |#
#| Make sure to update the version |#
Expand Down

0 comments on commit 743a7d6

Please sign in to comment.