Install pyvisa

Author: f | 2025-04-24

★★★★☆ (4.1 / 3432 reviews)

google drawimgs

Install the Python usb interface (so that PyVISA can search for devices on the USB bus) pip install pyvisa: Install the PyVisa environment: pip install pyvisa-py: Install the low level python drivers for PyVisa to use to talk to the bus: Then I tested the installation by running. Command Comment;

samsara driver

Installation Issue 196 pyvisa/pyvisa - GitHub

Trying with the latest from the master branch, 0147607: in ----> 1 rm = visa.ResourceManager()/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in __new__(cls, visa_library) 1576 def __new__(cls, visa_library=''): 1577 if not isinstance(visa_library, VisaLibraryBase):-> 1578 visa_library = open_visa_library(visa_library) 1579 1580 if visa_library.resource_manager is not None:/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in open_visa_library(specification) 1543 wrapper = 'ivi' 1544 else:-> 1545 wrapper = _get_default_wrapper() 1546 1547 cls = get_wrapper_class(wrapper)/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in _get_default_wrapper() 1517 except ValueError: 1518 logger.debug('Did not find pyvisa-py package')-> 1519 raise ValueError('Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.') 1520 1521 ValueError: Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.">$ ipythonPython 3.8.2 (default, Feb 26 2020, 22:21:03) Type 'copyright', 'credits' or 'license' for more informationIPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.In [1]: import pyvisa as visa In [2]: rm = visa.ResourceManager() ---------------------------------------------------------------------------ValueError Traceback (most recent call last) in ----> 1 rm = visa.ResourceManager()/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in __new__(cls, visa_library) 1576 def __new__(cls, visa_library=''): 1577 if not isinstance(visa_library, VisaLibraryBase):-> 1578 visa_library = open_visa_library(visa_library) 1579 1580 if visa_library.resource_manager is not None:/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in open_visa_library(specification) 1543 wrapper = 'ivi' 1544 else:-> 1545 wrapper = _get_default_wrapper() 1546 1547 cls = get_wrapper_class(wrapper)/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in _get_default_wrapper() 1517 except ValueError: 1518 logger.debug('Did not find pyvisa-py package')-> 1519 raise ValueError('Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.') 1520 1521 ValueError: Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.Everything is fine with the latest release, 1.10.1 I am trying to communicate with a Keithley 708A switch matrix that only has GPIB communication. I am using a GPIB_USB_HS adapter and I have tried installing linux-gpib (but this build fails) and pyvisa-ctypes and I still cannot see the instrument when using list_resources() or list_resources('@py').For some reason, pyvisa cannot load the gpib libraries as seen below:'gpib_ctypes is installed but could not locate the gpib library.'Please can someone help me understand why PYVISA cannot load it's own GPIB module?pyvisa-info/home/virgorun/.local/lib/python3.10/site-packages/gpib_ctypes/gpib/gpib.py:54: UserWarning: GPIB library not found. Please manually load it using _load_lib(filename). All GPIB functions will raise OSError until the library is manually loaded.warnings.warn(message)Machine Details:Platform ID: Linux-6.8.0-40-generic-x86_64-with-glibc2.35Processor: x86_64Python:Implementation: CPythonExecutable: /usr/bin/python3Version: 3.10.12Compiler: GCC 11.4.0Bits: 64bitBuild: Jul 29 2024 16:56:48 (#main)Unicode: UCS4PyVISA Version: 1.13.0Backends:ivi:Version: 1.13.0 (bundled with PyVISA)#1: /usr/lib/x86_64-linux-gnu/libvisa.so.24.5.0:found by: autobitness: 64Vendor: National InstrumentsImpl. Version: 25167104Spec. Version: 7340032py:Version: 0.7.2ASRL INSTR: Available via PySerial (3.5)USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1USB RAW: Available via PyUSB (1.2.1). Backend: libusb1TCPIP INSTR: AvailableResource discovery:- VXI-11: ok- hislip: okTCPIP SOCKET: AvailableVICP INSTR:Please install PyVICP to use this resource type.GPIB INSTR:gpib_ctypes is installed but could not locate the gpib library.Please manually load it using:gpib_ctypes.gpib.gpib._load_lib(filename)before importing pyvisa.GPIB INTFC:gpib_ctypes is installed but could not locate the gpib library.Please manually load it using:gpib_ctypes.gpib.gpib._load_lib(filename)before importing pyvisa.

pyvisa/pyvisa/shell.py at main pyvisa/pyvisa - GitHub

I have troubles using pyvisa-py to communicate with Keysight USBTMC devices on Linux:>> import visa; rm = visa.ResourceManager('@py'); l = rm.list_resources(); d = rm.open_resource(l[0])>>> d.ask('*IDN?')u'Agilent Technologies,34972A,MY49023315,1.17-1.12-02-02\n'>>> d.ask('*IDN?')Traceback (most recent call last): File "", line 1, in File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 407, in query return self.read() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 332, in read message = self.read_raw().decode(enco) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 306, in read_raw chunk, status = self.visalib.read(self.session, size) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 253, in read return self.sessions[session].read(count) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 102, in read usb.USBError) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/sessions.py", line 313, in _read current = reader() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 96, in return self._read(lambda: self.interface.read(1), File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 307, in read raw_write(req) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 204, in write raise ValueError(str(e))ValueError: [Errno 110] Operation timed out>>> ">Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import visa; rm = visa.ResourceManager('@py'); l = rm.list_resources(); d = rm.open_resource(l[0])>>> d.ask('*IDN?')u'Agilent Technologies,34972A,MY49023315,1.17-1.12-02-02\n'>>> d.ask('*IDN?')Traceback (most recent call last): File "", line 1, in File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 407, in query return self.read() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 332, in read message = self.read_raw().decode(enco) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 306, in read_raw chunk, status = self.visalib.read(self.session, size) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 253, in read return self.sessions[session].read(count) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 102, in read usb.USBError) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/sessions.py", line 313, in _read current = reader() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 96, in return self._read(lambda: self.interface.read(1), File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 307, in read raw_write(req) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 204, in write raise ValueError(str(e))ValueError: [Errno 110] Operation timed out>>> as you can see, the second '*IDN?' command fails. I see some. Install the Python usb interface (so that PyVISA can search for devices on the USB bus) pip install pyvisa: Install the PyVisa environment: pip install pyvisa-py: Install the low level python drivers for PyVisa to use to talk to the bus: Then I tested the installation by running. Command Comment;

pyvisa/pyvisa/highlevel.py at main pyvisa/pyvisa - GitHub

Hi,on the picture is my code with error.This is !python -m visa info:!python -m visa infoMachine Details:Platform ID: Windows-10-10.0.17134-SP0Processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntelPython:Implementation: CPythonExecutable: C:\Users\HP\Anaconda3\python.exeVersion: 3.7.3Compiler: MSC v.1915 64 bit (AMD64)Bits: 64bitBuild: Mar 27 2019 17:13:21 (#default)Unicode: UCS4PyVISA Version: 1.9.1Backends:ni:Version: 1.9.1 (bundled with PyVISA)#1: C:\windows\system32\visa32.dll:found by: autobitness: 64Vendor: National InstrumentsImpl. Version: 17827072Spec. Version: 5244928#2: C:\windows\system32\visa64.dll:found by: autobitness: 64Vendor: National InstrumentsImpl. Version: 17827072Spec. Version: 5244928py:Version: 0.3.1ASRL INSTR: Available via PySerial (3.4)USB INSTR:PyUSB does not seem to be properly installed.Please refer to PyUSB documentation andinstall a suitable backend likelibusb 0.1, libusb 1.0, libusbx,libusb-win32 or OpenUSB.No backend availableUSB RAW:PyUSB does not seem to be properly installed.Please refer to PyUSB documentation andinstall a suitable backend likelibusb 0.1, libusb 1.0, libusbx,libusb-win32 or OpenUSB.No backend availableTCPIP INSTR: AvailableTCPIP SOCKET: AvailableGPIB INSTR:Please install linux-gpib to use this resource type.No module named 'gpib'I think that I should install linux-gpib and PyUSB correctly. The problem is that I have no clue how to install linux-gpib and why PyUSB does not seem to be properly instaled? I am new to PyVISA, so please write only easy to understand advices (if I should install something without !pip ... please tell me which file executes installation; give me proper directory of installation; ... ).Thanks a lot! Applying Python and PvVISA to Automated TestingPython has become a widely used programming language in the area of electronic test automation, especially when used with the PyVISA library. While the fundamental principles of lab automation have been around for a long time (i.e., the SCPI protocol), Python and PyVISA have made it easy to get started quickly with test automation. Once data has been collected, Python also has a plethora of data analysis tools (pandas, scipy, scikit, etc.) that are useful in analyzing data.In this article, I will introduce how to interface with instruments using Python/PyVISA and give a practical example of measuring power supply efficiency. Finally, I will introduce how to plot gathered efficiency data directly in Python.SCPI ProtocolThe Standard Commands for Programmable Instruments (SCPI) is a definition layer on top of the Institute of Electrical and Electronics Engineers [IEEE]A professional association that is dedicated to advancing technological innovation and excellence." href=" data-mobile-support="0" data-gt-translate-attributes="[{"attribute":"data-cmtooltip", "format":"html"}]" tabindex="0" role="link">IEEE 488.2-1987 standard for instrument communication. While SCPI was originally meant for Institute of Electrical and Electronics Engineers [IEEE]A professional association that is dedicated to advancing technological innovation and excellence." href=" data-mobile-support="0" data-gt-translate-attributes="[{"attribute":"data-cmtooltip", "format":"html"}]" tabindex="0" role="link">IEEE 488.1 (GPIB connections), this has expanded to include RS-232A series of standards for serial binary single-ended data and control signals connecting between DTE (data terminal equipment) andDCE (data circuit-terminating equipment." href=" data-mobile-support="0" data-gt-translate-attributes="[{"attribute":"data-cmtooltip", "format":"html"}]" tabindex="0" role="link">RS-232, EthernetA family of computer networking technologies for local area networks (LANs)." href=" data-mobile-support="0" data-gt-translate-attributes="[{"attribute":"data-cmtooltip", "format":"html"}]" tabindex="0" role="link">Ethernet, USB, and several others. SCPI commands are sent in ASCII format and received as a string of ASCII text. Here is an example of a simple SCPI transaction:Host query: *IDN?Device reply: Siglent Technologies,SDL1020X‑E,SDLxxxxxxxxxxx,1.1.1.21R2\nSCPI defines a number of generic commands like MEASure and CONFigure, which can be used to read data from or configure parameters on test equipment.VISA SpecificationUnfortunately for the SCPI standard, different operating systems, interfaces, and devices meant that the early days of SCPI required different libraries for each device and bus system. In order to alleviate this pain, the Virtual Instrument Software Architecture (VISA) specification was created to seamlessly work with all devices and bus systems.Python and PyVISAEven with the VISA specification in place, it has traditionally been challenging to interface a host computer to measurement devices without expensive/cumbersome software and hardware. With these drawbacks in mind, the PyVISA library was created to simplify instrument communication and make lab automation more efficient.Python

pyvisa/pyvisa/util.py at main pyvisa/pyvisa - GitHub

Itself is a free, interpreted programming language that can be used with any modern operating system. Since this is an interpreted (and not compiled) language, Python can generally be “installed” on any system, even where the user does not have admin/root access. While the syntax of Python can take some getting used to (spaces are used as delimiters instead of ; or other characters), it is a very widely used language with many libraries, examples, and code snippets available.PyVISA works as a front end to the VISA library and simplifies the process of communicating with instruments. PyVISA is officially tested against National Instruments’ VISA and Keysight IO Library Suite and can be used with hardware adapters from National Instruments, Keysight, and many others.To get started, here is a simple program that queries what instruments are visible to PyVISA on my computer. In the below code snippet, I Amplitude Modulation [AM]One of the principal methods of transmitting audio, visual, or other types of information using radio waves, the relevant signal being superimposed onto a radio-frequency carrier wave. The frequency of the carrier wave remains unchanged but its amplitude is varied in accordance with the amplitude of the input signal." href=" data-mobile-support="0" data-gt-translate-attributes="[{"attribute":"data-cmtooltip", "format":"html"}]" tabindex="0" role="link">am using National Instruments VISA on a 64-bit Windows computer running Python 3.11.5 and PyVISA 1.13.0In [2]:import pyvisainstruments = pyvisa.ResourceManager().list_resources()instrumentsOut[2]:(‘USB0::0xF4EC::0x1621::SDL13GCQ6R0772::INSTR’,‘USB0::0x2A8D::0x3402::MY61003767::INSTR’,‘GPIB0::12::INSTR’,‘GPIB0::22::INSTR’)This output shows there are four instruments connected to my computer, two connected by USB and two by GPIB. Now we can create an object for each instrument and query what it is. Note that all instruments will reply to the special *IDN? Command:In [5]:for i in instruments: inst = pyvisa.ResourceManager().open_resource(i) print(i,inst.query(‘*IDN?’))USB0::0xF4EC::0x1621::SDL13GCQ6R0772::INSTR Siglent Technologies,SDL1020X-E,SDL13GCQ6R0772,1.1.1.21R2USB0::0x2A8D::0x3402::MY61003767::INSTR Keysight Technologies,E36234A,MY61003767,1.0.4-1.0.3-1.00GPIB0::12::INSTR HEWLETT-PACKARD,34401A,0,7-5-2GPIB0::22::INSTR HEWLETT-PACKARD,34401A,0,11-5-2From the query, you can see I have a Keysight power supply (E35234A) and a Siglent power supply (SDL1020X-E). For the following example, I Amplitude Modulation [AM]One of the principal methods of transmitting audio, visual, or other types of information using radio waves, the relevant signal being superimposed onto a radio-frequency carrier wave. The frequency of the carrier wave remains unchanged but its amplitude is varied in accordance with the amplitude of the input signal." href=" data-mobile-support="0" data-gt-translate-attributes="[{"attribute":"data-cmtooltip", "format":"html"}]" tabindex="0" role="link">am using the Siglent power supply only to read the input and output voltages of the device under test (DUT).Measuring EfficiencyFor a power supply, efficiency is the measure of how much power you get out per unit of power put in.

VISA installation problem Issue 149 pyvisa/pyvisa

Types of queries were tested in GPT-3.5 and GPT-4. I would like to note that the results in GPT-4 were not necessarily more or less insightful than GPT-3.5, what matters is the technical accuracy and not the depth or composition of the response. With that in mind, let’s look at some of the queries I tested in ChatGPT.Research SummarizationOne task where I think ChatGPT is very useful is as a research summarizer. For example, I sometimes need to get some overview of industry standards as part of a PCB design project, video, or article. For example, I like to use ChatGPT to determine:Lists of industry standards in certain areas (EMC, military, automotive, etc.)An overview of the contents in certain industry standardsAn overview of interface standards and how they are usedCertain calculations that might be needed as part of engineering an interconnect or PCBGenerating formulas that would be needed to calculate somethingCode GenerationAnother example comes from embedded design and testing. In the example below, I’m generating a python class for my older LeCroy 9300 oscilloscope so that I can capture data from the device. This was generated using GPT-4; GPT-3.5 was also successful, but it used the pyvisa class as the basis for the generated code. While I have not tested the code below, it does generate code with the correct Python syntax. Make sure you QC any generated code before using it in your system.Learn more about ChatGPT for test code generation High-Level How-To TasksThis is an area where ChatGPT gives mixed results. In the first set of queries I ran, I found that overgeneralized questions will yield overgeneralized answers. The generated results could be useful for new designers who want to know what they still need to learn, but they are not actionable for an experienced designer and they overgeneralize information across multiple queries.For example, I queried ChatGPT for guidance on how to design three types of boards:High-speed PCBsRF PCBsHigh-density PCBsThe results that were generated were practically identical across all three types of boards. The system simply replaced “high-speed PCB” with “RF PCB” and “high-density PCB” when generating the. Install the Python usb interface (so that PyVISA can search for devices on the USB bus) pip install pyvisa: Install the PyVisa environment: pip install pyvisa-py: Install the low level python drivers for PyVisa to use to talk to the bus: Then I tested the installation by running. Command Comment; Python-PyVisa Reading data from Data Acquistion Unit (Model: Keysight A/DAQ970A) using PyVisa and Raspberrypi. Install PyVisa on Raspberry Pi: pip install PyVISA

Mac Installation: VI_ERROR_LIBRARY_NFOUND Issue 375 pyvisa/pyvisa

-f \ install python -m pip install detectron2==0.4 -f \ install python -m pip install detectron2==0.4 -f \ 9.2 install python -m pip install detectron2==0.4 -f \ install python -m pip install detectron2==0.4 -f \ cpu install python -m pip install detectron2==0.4 -f \ install python -m pip install detectron2==0.4 -f \ install python -m pip install detectron2==0.4 -f \ v0.3 Features & Improvements:Support constructing RetinaNet, data loader, optimizer, COCOEvaluator without configs, in addition to Mask R-CNN.Add DeepLab & PanopticDeepLab in projects/.Support importing 3 projects (point_rend, deeplab, panoptic_deeplab) directly with import detectron2.projects.xxx.Support mixed precision in training (using cfg.SOLVER.AMP.ENABLED) and inference.Support ADE20k semantic segmentation dataset (named ade20k_sem_seg_train, ade20k_sem_seg_val).Continuous build on Windows.Pre-built Linux binaries are provided for the following environment: CUDA torch 1.7torch 1.6torch 1.5 11.0 install python -m pip install detectron2==0.3 -f \ 10.2 install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ 10.1 install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ 9.2 install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ cpu install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ install python -m pip install detectron2==0.3 -f \ v0.2.1 Added pre-built binary for PyTorch 1.6 CUDA torch 1.6torch 1.5torch 1.4 10.2 install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ 10.1 install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ 10.0 install python -m pip install detectron2==0.2.1 -f \ 9.2 install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ cpu install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ install python -m pip install detectron2==0.2.1 -f \ v0.2 Features & Improvements:Support constructing objects with either configs or explicit arguments. As an example, the entire Mask R-CNN can be built without using configsRename TransformGen to Augmentation and keep TransformGen as an alias. Design the interface of Augmentation so that it can access arbitrary custom data types. See augmentation tutorial for details.Improve speed of COCOEvaluator by about 3xSupport LVIS v1 datasetSupport GIoU loss in RPN and R-CNNSupport auto-scaling of batch size and learning rate in DefaultTrainer. See cfg.SOLVER.REFERENCE_WORLD_SIZEPre-built Linux binaries are provided for the following environment: CUDA torch 1.5torch 1.4 10.2 install python -m pip install detectron2==0.2 -f \ 10.1 install python -m pip install detectron2==0.2 -f \ install python -m pip install detectron2==0.2 -f \ 10.0 install python -m pip install detectron2==0.2 -f \ 9.2 install python -m pip install detectron2==0.2 -f \ install python -m pip install detectron2==0.2 -f \ cpu install python -m pip install detectron2==0.2 -f \ install python -m

Comments

User2661

Trying with the latest from the master branch, 0147607: in ----> 1 rm = visa.ResourceManager()/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in __new__(cls, visa_library) 1576 def __new__(cls, visa_library=''): 1577 if not isinstance(visa_library, VisaLibraryBase):-> 1578 visa_library = open_visa_library(visa_library) 1579 1580 if visa_library.resource_manager is not None:/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in open_visa_library(specification) 1543 wrapper = 'ivi' 1544 else:-> 1545 wrapper = _get_default_wrapper() 1546 1547 cls = get_wrapper_class(wrapper)/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in _get_default_wrapper() 1517 except ValueError: 1518 logger.debug('Did not find pyvisa-py package')-> 1519 raise ValueError('Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.') 1520 1521 ValueError: Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.">$ ipythonPython 3.8.2 (default, Feb 26 2020, 22:21:03) Type 'copyright', 'credits' or 'license' for more informationIPython 7.13.0 -- An enhanced Interactive Python. Type '?' for help.In [1]: import pyvisa as visa In [2]: rm = visa.ResourceManager() ---------------------------------------------------------------------------ValueError Traceback (most recent call last) in ----> 1 rm = visa.ResourceManager()/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in __new__(cls, visa_library) 1576 def __new__(cls, visa_library=''): 1577 if not isinstance(visa_library, VisaLibraryBase):-> 1578 visa_library = open_visa_library(visa_library) 1579 1580 if visa_library.resource_manager is not None:/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in open_visa_library(specification) 1543 wrapper = 'ivi' 1544 else:-> 1545 wrapper = _get_default_wrapper() 1546 1547 cls = get_wrapper_class(wrapper)/usr/lib/python3.8/site-packages/pyvisa/highlevel.py in _get_default_wrapper() 1517 except ValueError: 1518 logger.debug('Did not find pyvisa-py package')-> 1519 raise ValueError('Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.') 1520 1521 ValueError: Could not locate a VISA implementation. Install either the IVI binary or pyvisa-py.Everything is fine with the latest release, 1.10.1

2025-04-08
User8891

I am trying to communicate with a Keithley 708A switch matrix that only has GPIB communication. I am using a GPIB_USB_HS adapter and I have tried installing linux-gpib (but this build fails) and pyvisa-ctypes and I still cannot see the instrument when using list_resources() or list_resources('@py').For some reason, pyvisa cannot load the gpib libraries as seen below:'gpib_ctypes is installed but could not locate the gpib library.'Please can someone help me understand why PYVISA cannot load it's own GPIB module?pyvisa-info/home/virgorun/.local/lib/python3.10/site-packages/gpib_ctypes/gpib/gpib.py:54: UserWarning: GPIB library not found. Please manually load it using _load_lib(filename). All GPIB functions will raise OSError until the library is manually loaded.warnings.warn(message)Machine Details:Platform ID: Linux-6.8.0-40-generic-x86_64-with-glibc2.35Processor: x86_64Python:Implementation: CPythonExecutable: /usr/bin/python3Version: 3.10.12Compiler: GCC 11.4.0Bits: 64bitBuild: Jul 29 2024 16:56:48 (#main)Unicode: UCS4PyVISA Version: 1.13.0Backends:ivi:Version: 1.13.0 (bundled with PyVISA)#1: /usr/lib/x86_64-linux-gnu/libvisa.so.24.5.0:found by: autobitness: 64Vendor: National InstrumentsImpl. Version: 25167104Spec. Version: 7340032py:Version: 0.7.2ASRL INSTR: Available via PySerial (3.5)USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1USB RAW: Available via PyUSB (1.2.1). Backend: libusb1TCPIP INSTR: AvailableResource discovery:- VXI-11: ok- hislip: okTCPIP SOCKET: AvailableVICP INSTR:Please install PyVICP to use this resource type.GPIB INSTR:gpib_ctypes is installed but could not locate the gpib library.Please manually load it using:gpib_ctypes.gpib.gpib._load_lib(filename)before importing pyvisa.GPIB INTFC:gpib_ctypes is installed but could not locate the gpib library.Please manually load it using:gpib_ctypes.gpib.gpib._load_lib(filename)before importing pyvisa.

2025-03-26
User9273

I have troubles using pyvisa-py to communicate with Keysight USBTMC devices on Linux:>> import visa; rm = visa.ResourceManager('@py'); l = rm.list_resources(); d = rm.open_resource(l[0])>>> d.ask('*IDN?')u'Agilent Technologies,34972A,MY49023315,1.17-1.12-02-02\n'>>> d.ask('*IDN?')Traceback (most recent call last): File "", line 1, in File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 407, in query return self.read() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 332, in read message = self.read_raw().decode(enco) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 306, in read_raw chunk, status = self.visalib.read(self.session, size) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 253, in read return self.sessions[session].read(count) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 102, in read usb.USBError) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/sessions.py", line 313, in _read current = reader() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 96, in return self._read(lambda: self.interface.read(1), File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 307, in read raw_write(req) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 204, in write raise ValueError(str(e))ValueError: [Errno 110] Operation timed out>>> ">Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import visa; rm = visa.ResourceManager('@py'); l = rm.list_resources(); d = rm.open_resource(l[0])>>> d.ask('*IDN?')u'Agilent Technologies,34972A,MY49023315,1.17-1.12-02-02\n'>>> d.ask('*IDN?')Traceback (most recent call last): File "", line 1, in File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 407, in query return self.read() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 332, in read message = self.read_raw().decode(enco) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa/resources/messagebased.py", line 306, in read_raw chunk, status = self.visalib.read(self.session, size) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 253, in read return self.sessions[session].read(count) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 102, in read usb.USBError) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/sessions.py", line 313, in _read current = reader() File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/usb.py", line 96, in return self._read(lambda: self.interface.read(1), File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 307, in read raw_write(req) File "/home/manip/src/test-pyvisa-py/local/lib/python2.7/site-packages/pyvisa-py/protocols/usbtmc.py", line 204, in write raise ValueError(str(e))ValueError: [Errno 110] Operation timed out>>> as you can see, the second '*IDN?' command fails. I see some

2025-03-29
User5592

Hi,on the picture is my code with error.This is !python -m visa info:!python -m visa infoMachine Details:Platform ID: Windows-10-10.0.17134-SP0Processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntelPython:Implementation: CPythonExecutable: C:\Users\HP\Anaconda3\python.exeVersion: 3.7.3Compiler: MSC v.1915 64 bit (AMD64)Bits: 64bitBuild: Mar 27 2019 17:13:21 (#default)Unicode: UCS4PyVISA Version: 1.9.1Backends:ni:Version: 1.9.1 (bundled with PyVISA)#1: C:\windows\system32\visa32.dll:found by: autobitness: 64Vendor: National InstrumentsImpl. Version: 17827072Spec. Version: 5244928#2: C:\windows\system32\visa64.dll:found by: autobitness: 64Vendor: National InstrumentsImpl. Version: 17827072Spec. Version: 5244928py:Version: 0.3.1ASRL INSTR: Available via PySerial (3.4)USB INSTR:PyUSB does not seem to be properly installed.Please refer to PyUSB documentation andinstall a suitable backend likelibusb 0.1, libusb 1.0, libusbx,libusb-win32 or OpenUSB.No backend availableUSB RAW:PyUSB does not seem to be properly installed.Please refer to PyUSB documentation andinstall a suitable backend likelibusb 0.1, libusb 1.0, libusbx,libusb-win32 or OpenUSB.No backend availableTCPIP INSTR: AvailableTCPIP SOCKET: AvailableGPIB INSTR:Please install linux-gpib to use this resource type.No module named 'gpib'I think that I should install linux-gpib and PyUSB correctly. The problem is that I have no clue how to install linux-gpib and why PyUSB does not seem to be properly instaled? I am new to PyVISA, so please write only easy to understand advices (if I should install something without !pip ... please tell me which file executes installation; give me proper directory of installation; ... ).Thanks a lot!

2025-04-17

Add Comment