How to fix PyVISA 'ValueError: Could not locate a VISA implementation. Install either the NI binary or pyvisa-py.'
Problem:
You are trying to use PyVISA to connect to an instrument, but you see an error message like
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.Solution
Install the pyvisa-py Python package:
example.sh
pip install -U pyvisa-pyor, if you are still using Python 2.x:
example.sh
pip2 install pyvisa-pyCheck out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow