Skip to content

Commit

Permalink
check on python3 dependencies (#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredroy authored Aug 7, 2024
1 parent 4238417 commit 00e7bd8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bindings/SofaRuntime/package/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
###################### MODULES INPORTS & UNLOAD FEATURES ######################
###############################################################################


try:
import numpy
except ModuleNotFoundError as error:
Sofa.msg_error("SofaRuntime",str(error))
Sofa.msg_error("SofaRuntime", 'numpy is mandatory for SofaPython3')
sys.exit(1)

try:
import scipy
except ModuleNotFoundError as error:
Sofa.msg_warning("SofaRuntime",str(error))
Sofa.msg_warning("SofaRuntime", "scipy is strongly recommended for SofaPython3")
pass

# Keep a list of the modules always imported in the Sofa-PythonEnvironment
try:
__SofaPythonEnvironment_importedModules__
Expand Down

0 comments on commit 00e7bd8

Please sign in to comment.