Registry / data / zhinst

zhinst

JSON →
library26.4.0pypypi✓ verified 83d ago

Official Python API for Zurich Instruments device control and data acquisition. Current version 26.4.0, requires Python ≥3.10. Major releases every few months with API changes; LabOne software version compatibility is critical.

pip install zhinst
INSTALL
IMPORT
SIG · ZHINST
Z
zhinst
datapythonv26.4.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ziSession
from zhinst.toolkit import Session
from zhinst.core import Session
Session moved to toolkit in v21+
DataServer
from zhinst.core import ziDAQServer
from zhinst import DataServer
Class name is ziDAQServer, not DataServer

Connect to a Zurich Instruments device via Data Server using toolkit Session.

import os from zhinst.toolkit import Session server_host = os.environ.get('ZI_SERVER_HOST', 'localhost') server_port = int(os.environ.get('ZI_SERVER_PORT', 8004)) api_level = 6 session = Session(server_host, server_port, api_level) device_id = os.environ.get('ZI_DEVICE_ID', 'dev1234') a = session.connect_device(device_id) print('Connected:', a) # Example: set output amplitude awg = a.awgs[0] awg.amplitude(0.5) print('Amplitude set to:', awg.amplitude())
Debug
Known issues
gotchaThe 'zhinst' package requires the LabOne Data Server to be running; the API does not start it automatically.
fix
Start the Data Server (ziServer) before running your Python script.
affects: all
breakingIn v23+ the 'zhinst.core' subpackage was reorganized; many classes moved or were renamed (e.g., 'ziDAQServer' instead of 'DataServer').
fix
Use 'zhinst.core.ziDAQServer' and 'zhinst.toolkit.Session'.
affects: >=23.0.0
gotchaAPI level must match the LabOne version; using the wrong API level causes silent errors or connection failures.
fix
Set api_level=6 for LabOne 23+; check labOne compatibility table.
affects: all
deprecatedThe 'zhinst.examples' and 'zhinst.ziPython' modules are deprecated since v22.
fix
Use 'zhinst.toolkit' or refer to official examples repository.
affects: >=22.0.0
Errors
Common errors & fixes
ImportError: cannot import name 'Session' from 'zhinst'
Incorrect import path; Session is in zhinst.toolkit.
fix
Use: from zhinst.toolkit import Session
ModuleNotFoundError: No module named 'zhinst.core'
Package not installed; older version may have different subpackage structure.
fix
Install latest zhinst: pip install --upgrade zhinst
zhinst.exceptions.ZIError: Data server not responding.
Data Server (ziServer) not running or wrong host/port.
fix
Start LabOne Data Server and ensure 'localhost:8004' is accessible.
Upgrade
Version history
26.4.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
numpyrequiredNumerical data handling
matplotliboptionalPlotting (optional)
pyvisa-pyoptionalVISA backend for instrument communication
Agent activity
57 hits · last 30 days
node
46
Amazon
1
OpenAI (training)
1
Resources
zhinst — pip install zhinst · libregistry