gpt4 book ai didi

python - 使用 PyVISA 时出错

转载 作者:太空宇宙 更新时间:2023-11-04 03:37:11 49 4
gpt4 key购买 nike

我刚刚安装了 PyVISA使用 pip

import visa
rs = visa.ResourceManager()

我收到这个错误

Traceback (most recent call last):

File "", line 1, in

File "C:\Anaconda3\lib\site-packages\pyvisa\highlevel.py", line 1486, in new

obj.session, err = visa_library.open_default_resource_manager()

File "C:\Anaconda3\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1212, in open_default_resource_manager

ret = library.viOpenDefaultRM(byref(session))

File "C:\Anaconda3\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 180, in _return_handler

raise errors.VisaIOError(ret_value)

pyvisa.errors.VisaIOError: VI_ERROR_LIBRARY_NFOUND (-1073807202): A code library required by VISA could not be located or loaded.

发布了一个类似的问题 here ,根据那里的建议,我在命令提示符下尝试了以下操作:python -c "from pyvisa import util; util.get_debug_info()" & 我得到了这个回复,

enter image description here

从上图可以看出,两种情况下的错误信息是一样的,我还检查了NI MAX的Visa版本:Visa 4.3

enter image description here

我是否遗漏了什么,有人可以帮忙吗?

最佳答案

最后,我通过升级 NI VISA 解决了这个问题。来自 4.3 的版本至 5.4.1 .

  • 从控制面板卸载旧的 NI-VISA 版本(National Instruments Software --> Products --> NI-VISA 4.3 & Remove)
  • here 安装 NI-VISA 5.4.1并重启你的电脑

不确定为什么 Visa 4.3 会产生这个问题,但无论如何 VISA Ver. 5.4.1 是我的解决方案。

关于python - 使用 PyVISA 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28498453/

49 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com