我在raspberry pi2上安装pyvisa-py pn时出现错误,这是
ImportError:无法导入名称rname
运行命令后
rm = visa.ResourceManager('@py')
以下是中断者给出的消息:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/pyvisa/highlevel.py", line 1477, in new
visa_library = open_visa_library(visa_library)
File "/usr/local/lib/python2.7/dist-packages/pyvisa/highlevel.py", line 1446, in open_visa_library
cls = get_wrapper_class(wrapper)
File "/usr/local/lib/python2.7/dist-packages/pyvisa/highlevel.py", line 1426, in get_wrapper_class
pkg = import(pkgname)
File "/usr/local/lib/python2.7/dist-packages/pyvisa-py/init.py", line 26, in
from .highlevel import PyVisaLibrary
File "/usr/local/lib/python2.7/dist-packages/pyvisa-py/highlevel.py", line 20, in
from pyvisa import constants, errors, highlevel, rname
ImportError: cannot import name rname
此外,以下是python -m签证信息返回的内容:
Machine Details:
Platform ID: Linux-3.18.11-v7+-armv7l-with-debian-7.8
Processor:
Python:
Implementation: CPython
Executable: /usr/bin/python
Version: 2.7.3
Compiler: GCC 4.6.3
Bits: 32bit
Build: Mar 18 2014 05:13:23 (#default)
Unicode: UCS4
PyVISA Version: 1.6.3
Backends:
ni:
Version: 1.6.3 (bundled with PyVISA)
Binary library: Not found
py:
Could not instantiate backend
-> cannot import name rname
sim:
Does not provide debug info
有人能帮我解决吗?非常感谢
答案 0 :(得分:1)
https://github.com/hgrecco/pyvisa/issues/149解释了如何解决此问题。简而言之,你似乎有一个pyvisa-py需要更新的(开发)版本的pyvisa。