diff --git a/csaxs_bec/devices/allied_vision_cameras/base_integration/camera.py b/csaxs_bec/devices/allied_vision_cameras/base_integration/camera.py index 0ce200e..26e92a4 100644 --- a/csaxs_bec/devices/allied_vision_cameras/base_integration/camera.py +++ b/csaxs_bec/devices/allied_vision_cameras/base_integration/camera.py @@ -46,12 +46,6 @@ class Camera: """ def __init__(self, camera_id: str, connect: bool = True): - if Aravis is None: - raise ImportError( - "The Aravis library is not installed, or its GObject Introspection typelib" - " is missing. Please check your Python environment (PyGObject) and Aravis" - " installation." - ) self.Aravis = Aravis self.GLib = GLib self.camera_id = camera_id @@ -72,6 +66,12 @@ class Camera: def on_connect(self): """Connect to the camera and initialize it.""" + if self.Aravis is None: + raise ImportError( + "The Aravis library is not installed, or its GObject Introspection typelib" + " is missing. Please check your Python environment (PyGObject) and Aravis" + " installation." + ) if self._connected: logger.warning("Camera is already connected.") return