首页 > 解决方案 > 未找到 PyVisa 二进制库

问题描述

二进制库:未找到错误。

我正在使用 Windows 10 从 Git Bash 运行并使用 pip 安装软件包。

我从他们的网站以及 pyVISA 和 pyVISA-py 软件包安装了 Ni-VISA。
我在 C:\Windows\System32 中有 visa32.dll 和 visa64.dll。

我已经尝试安装 pyvisa-py 的开发版本。不工作。我在 Windows 的“系统变量”下的路径与另一台正常工作的机器上的路径相同。

在此先感谢您的帮助。我很尴尬地说我花了多少时间在这上面。

Machine Details:
   Platform ID:    Windows-10-10.0.18362
   Processor:      Intel64 Family 6 Model 142 Stepping 9, GenuineIntel

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

PyVISA Version: 1.9.1

Backends:
   ni:
      Version: 1.9.1 (bundled with PyVISA)
      Binary library: Not found
   py:
      Version: 0.3.1
      ASRL INSTR: Available via PySerial (3.4)
      TCPIP INSTR: Available
      USB RAW:
         Please install PyUSB to use this resource type.
         No module named usb
      USB INSTR:
         Please install PyUSB to use this resource type.
         No module named usb
      GPIB INSTR:
         Please install linux-gpib to use this resource type.
         No module named gpib
      TCPIP SOCKET: Available

在终端中使用 Python 的路径和“import sys;print(sys.path)”

['', 'C:\\WINDOWS\\SYSTEM32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\win32', 'C:\\Python27\\lib\\site-packages\\win32\\lib', 'C:\\Python27\\lib\\site-packages\\Pythonwin']

我希望有

Backends:
   ni:
      Version: 1.9.1 (bundled with PyVISA)
      #1: C:\Windows\system32\visa32.dll:
         found by: auto
         bitness:32
         Vendor: Keysight Technologies
         Impl. Version: 1364384898
         Spec. Version: 5243136

标签: pythonpyvisa

解决方案


最后,想通了。

在目录 C:\Users[username] 中,创建或修改.pyvisarc文件(这是唯一的文件扩展名)。然后在其中添加以下指向您的visa32.dll的文本:

[Paths]

VISA library: C:/Windows/System32/visa32.dll

语法很重要。此外,如果您为了安全起见,请重新启动终端,然后python -m visa info终端命令应显示预期的 NI 后端。

这是其他系统文档的链接


推荐阅读