如何修复 PyVISA 'ValueError: Could not locate a VISA implementation. Install either the NI binary or pyvisa-py.'
问题:
你正在尝试使用 PyVISA 连接到仪器,但你看到类似这样的错误消息
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.解决方案
安装 pyvisa-py Python 包:
install_pyvisa_py.sh
pip install -U pyvisa-py或者,如果你仍在使用 Python 2.x:
install_pyvisa_py_py2.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