pyvisa无法定位VISA实现

2024-10-01 09:17:37 发布

您现在位置:Python中文网/ 问答频道 /正文

pyvisa无法定位VISA实现,无法加载NI-VISA后端:

>>> import visa
>>> import platform
>>> print(platform.architecture())
('64bit', 'WindowsPE')
>>> rm = visa.ResourceManager(visa_library="C:\\Windows\\System32\\visa64.dll")
ValueError: Could not locate a VISA implementation. Install either the NI binary or pyvisa-py.

系统设置:

  • Windows 10 Pro v1709(64位)
  • python v2.7.15(64位)
  • pyvisa v1.9.1版
  • NI签证17.50

我已验证.dll文件是否存在:

  • C: \visa32\Windows系统动态链接库
  • C: \Windows\System32\visa64.dll

以及pyvisa.info公司内容如下:

C:\Python27>python -m visa info Machine Details: Platform ID:
Windows-10-10.0.16299 Processor: Intel64 Family 6 Model 60 Stepping 3, GenuineIntel

Python: Implementation: CPython Executable:
C:\Python27\python.exe Version: 2.7.15 Compiler:
MSC v.1500 64 bit (AMD64) Bits: 64bit Build:
Apr 30 2018 16:30:26 (#v2.7.15:ca079a3ea3) Unicode: UCS2

PyVISA Version: 1.9.1 Backends: ni: Version: 1.9.1 (bundled with PyVISA) Binary library: Not found

但由于某些原因,pyvisa无法加载NI-VISA后端。如果后端未指定,也会发生同样的情况:

^{pr2}$

我可以单独加载.dll:

ctypes.windll.LoadLibrary("C:\\Windows\\System32\\visa32.dll")

这意味着visa没有正确传递“visa_library”参数,即pyvisa正在搜索路径(失败),而不是使用指定的后端。在


Tags: importinfoversionwindows系统libraryvisadll