{"id":24361,"library":"pymeasure","title":"PyMeasure","description":"PyMeasure is a scientific measurement library for Python that provides instrument communication, experiment management, and live-plotting. As of version 0.15.0 (January 2025), it supports Python >=3.8 and has moved to pyproject.toml. The library is actively maintained with frequent releases featuring new instrument drivers and improvements.","status":"active","version":"0.15.0","language":"python","source_language":"en","source_url":"https://github.com/pymeasure/pymeasure","tags":["measurement","instrument-control","lab-automation","scientific"],"install":[{"cmd":"pip install pymeasure","lang":"bash","label":"Standard install"},{"cmd":"pip install pymeasure[all]","lang":"bash","label":"With all optional dependencies (e.g., serial, VISA)"}],"dependencies":[{"reason":"Required for VISA-based instrument communication","package":"pyvisa","optional":true},{"reason":"Required for serial port communication","package":"pyserial","optional":true},{"reason":"Required for numeric operations","package":"numpy","optional":false},{"reason":"Required for data handling and experiment management","package":"pandas","optional":false}],"imports":[{"note":"Instrument is in the instruments subpackage","wrong":"from pymeasure import Instrument","symbol":"Instrument","correct":"from pymeasure.instruments import Instrument"},{"note":"ManagedWindow is in the display subpackage","wrong":"from pymeasure import ManagedWindow","symbol":"ManagedWindow","correct":"from pymeasure.display import ManagedWindow"},{"note":"Procedure is in the experiment subpackage","wrong":"from pymeasure import Procedure","symbol":"Procedure","correct":"from pymeasure.experiment import Procedure"}],"quickstart":{"code":"import pymeasure\nfrom pymeasure.instruments.keithley import Keithley2400\nfrom pymeasure.experiment import Procedure, Results\nfrom pymeasure.display import ManagedWindow\n\n# Check version\nprint(pymeasure.__version__)\n\n# Example: create a Keithley 2400 instrument (simulated if no hardware)\ntry:\n    keithley = Keithley2400(\"GPIB0::24::INSTR\")\n    print(keithley.id)\nexcept Exception as e:\n    print(f\"Could not connect: {e}\")\n\n# Define a simple procedure\nclass MyProcedure(Procedure):\n    def execute(self):\n        import time\n        for i in range(5):\n            self.emit('data', {'i': i})\n            time.sleep(0.1)\n\n# Create and run procedure\nresults = Results(MyProcedure(), 'test.csv')\nprint('Procedure created. See framework documentation for full GUI usage.')","lang":"python","description":"Quickstart: import PyMeasure, create an instrument, define a procedure, and run it."},"warnings":[{"fix":"Replace `from pymeasure.instruments.rohdeschwarz.fsl import FSL` with `from pymeasure.instruments.rohdeschwarz.fsseries import FSL`","message":"The FSL class from `pymeasure.instruments.rohdeschwarz.fsl` is deprecated. Use `pymeasure.instruments.rohdeschwarz.fsseries` instead.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Use the new `move_raw` method instead.","message":"Attocube ANC300: `stepu` and `stepd` properties are deprecated.","severity":"deprecated","affected_versions":">=0.13.0"},{"fix":"Upgrade Python to 3.8 or later. For older Python, use pymeasure<0.13.0.","message":"In version 0.13.0, support for Python 3.7 was dropped. Python 3.8+ required.","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"Use proper connection strings like 'GPIB0::24::INSTR', 'ASRL/dev/ttyUSB0::INSTR', or 'TCPIP0::192.168.1.1::inst0::INSTR'.","message":"Instrument initialization often requires a connection string. Using an incorrect string (e.g., missing protocol prefix) can cause cryptic VISA errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Ensure correct installation: `pip install pymeasure` (or `pip install --upgrade pymeasure`). Also check for pip conflicts (e.g., multiple environments).","cause":"PyMeasure is not installed or installed incorrectly (e.g., missing subpackage).","error":"ModuleNotFoundError: No module named 'pymeasure.instruments'"},{"fix":"Use `from pymeasure.instruments import Instrument` instead of `from pymeasure import instruments`.","cause":"The top-level pymeasure package does not export subpackages; you must import from the correct subpackage.","error":"AttributeError: module 'pymeasure' has no attribute 'instruments'"},{"fix":"Increase the timeout: `instrument = Keithley2400(\"GPIB0::24::INSTR\", timeout=5000)` or check the physical connection and address.","cause":"The instrument did not respond within the default timeout. This often happens with slow instruments or incorrect connection settings.","error":"VisaIOError: VI_ERROR_TMO (-1073807339) – Timeout expired before operation completed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}