PyVISA beheben: 'ValueError: Could not locate a VISA implementation. Install either the NI binary or pyvisa-py.'

English Deutsch

Problem:

Sie versuchen, PyVISA zu verwenden, um eine Verbindung zu einem Instrument herzustellen, aber Sie sehen eine Fehlermeldung wie

pyvisa_traceback.txt
Traceback (most recent call last):
  File "TestPyVISA.py", line 3, in <module>
    rm = visa.ResourceManager()
  File "/usr/local/lib/python3.7/dist-packages/pyvisa/highlevel.py", line 1526, in __new__
    visa_library = open_visa_library(visa_library)
  File "/usr/local/lib/python3.7/dist-packages/pyvisa/highlevel.py", line 1493, in open_visa_library
    wrapper = _get_default_wrapper()
  File "/usr/local/lib/python3.7/dist-packages/pyvisa/highlevel.py", line 1470, in _get_default_wrapper
    raise ValueError('Could not locate a VISA implementation. Install either the NI binary or pyvisa-py.')
ValueError: Could not locate a VISA implementation. Install either the NI binary or pyvisa-py.

Lösung

Installieren Sie das Python-Paket pyvisa-py:

install_pyvisa_py.sh
pip install -U pyvisa-py

oder, falls Sie noch Python 2.x verwenden:

install_pyvisa_py_py2.sh
pip2 install pyvisa-py

Check out similar posts by category: Python