diff --git a/python/chemiscope/structures/_shapes.py b/python/chemiscope/structures/_shapes.py index 5c84c9d5b..ae06c1957 100644 --- a/python/chemiscope/structures/_shapes.py +++ b/python/chemiscope/structures/_shapes.py @@ -146,8 +146,12 @@ def ellipsoid_from_tensor(tensor, scale=1.0, force_positive=False): rotation = eigenvectors.T # converts to quaternion - from scipy.spatial.transform import Rotation - + try: + from scipy.spatial.transform import Rotation + except ImportError as e: + raise RuntimeError( + "scipy is required to construct arrow shapes" + ) from e quaternion = Rotation.from_matrix(rotation).as_quat() return dict(