PyVISA-AttributeError:“ NIVisaLibrary”对象没有属性“ viParseRsrcEx”

时间:2018-07-25 13:55:44

标签: python pyvisa

我正在尝试使用以下代码连接设备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?'))

但是它返回错误:

/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 

我正在使用带有Python 2.7解释器的Ubuntu 16.04,PyCharm,并且我已经导入了以下库:

libraries

此信息可能有所帮助:命令 “ python -m签证信息” 返回:

pyvisa info

1 个答案:

答案 0 :(得分:0)

这看起来像是VISA后端的问题。如果您打算使用PyVISA-py作为后端,请you have to select it first。将N^2更改为N^2