zhinst-utils

raw JSON →
0.7.2 verified Mon Apr 27 auth: no python

Zurich Instruments utilities for device control, data acquisition, and lab automation. Compatible with Python >=3.7, latest version 0.7.2. Released irregularly.

pip install zhinst-utils
error ModuleNotFoundError: No module named 'zhinst'
cause zhinst-core not installed.
fix
pip install zhinst-core
error AttributeError: module 'zhinst.utils' has no attribute 'get_zi_device'
cause Using outdated import path or old version (<0.5.0).
fix
Upgrade zhinst-utils: pip install --upgrade zhinst-utils
breaking Version 0.5.0 renamed many functions and removed deprecated aliases. Older imports like from zhinst.utils import lockin will fail.
fix Update imports to current API: from zhinst.utils import get_zi_device, etc.
deprecated The function `zhinst.utils.get_zi_devices()` is deprecated in favor of `zhinst.utils.discover_devices()`.
fix Use `discover_devices()` instead.
gotcha The package does not install zhinst-core automatically; you must install it separately.
fix Run `pip install zhinst-core` or use `pip install zhinst-utils[all]`.

Quick connection to a Zurich Instruments device using environment variable for device ID.

import os
from zhinst.utils import get_zi_device

device_id = os.environ.get('ZI_DEVICE_ID', 'dev1234')
try:
    device = get_zi_device(device_id)
    print(f"Connected to {device}")
except Exception as e:
    print(f"Connection failed: {e}")