PyVISA - AttributeError: 'NIVisaLibrary' object has no attribute 'viParseRsrcEx'

PyVISA - AttributeError: 'NIVisaLibrary' object has no attribute 'viParseRsrcEx'

我正在尝试使用此代码连接到 Chroma 63600 设备:

import visa
rm = visa.ResourceManager()
print rm.list_resources()
my_instrument = rm.open_resource(u'USB2::0x0a69::0x083e::636005000984')
print(my_instrument.query('*IDN?'))

但是returns错误:

/root/PycharmProjects/Teste/venv/bin/python /root/PycharmProjects/Teste/Teste.py
(u'USB2::0x0a69::0x083e::636005000984',)
Traceback (most recent call last):
  File "/root/PycharmProjects/Teste/Teste.py", line 4, in <module>
    my_instrument = rm.open_resource(u'USB2::0x0a69::0x083e::636005000984',)
  File "/root/PycharmProjects/Teste/venv/local/lib/python2.7/site-packages/pyvisa/highlevel.py", line 1634, in open_resource
    info = self.resource_info(resource_name, extended=True)
  File "/root/PycharmProjects/Teste/venv/local/lib/python2.7/site-packages/pyvisa/highlevel.py", line 1594, in resource_info
    ret, err = self.visalib.parse_resource_extended(self.session, resource_name)
  File "/root/PycharmProjects/Teste/venv/local/lib/python2.7/site-packages/pyvisa/ctwrapper/functions.py", line 1380, in parse_resource_extended
    ret = library.viParseRsrcEx(session, resource_name, byref(interface_type),
AttributeError: 'NIVisaLibrary' object has no attribute 'viParseRsrcEx'

Process finished with exit code 1 

我正在使用 Ubuntu 16.04,PyCharm 和 Python 2.7 解释器,我已经导入了这个库:

libraries

也许这些信息有帮助:命令 "python -m visa info" returns:

pyvisa info

这看起来像是 VISA 后端的问题。如果您打算使用 PyVISA-py 作为后端,you have to select it first。将 rm = visa.ResourceManager() 更改为 rm = visa.ResourceManager('@py')