python - 未找到 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
解决方案
最后,想通了。
在目录 C:\Users[username] 中,创建或修改.pyvisarc文件(这是唯一的文件扩展名)。然后在其中添加以下指向您的visa32.dll的文本:
[Paths]
VISA library: C:/Windows/System32/visa32.dll
语法很重要。此外,如果您为了安全起见,请重新启动终端,然后python -m visa info
终端命令应显示预期的 NI 后端。
推荐阅读
- ssl - DNS 重新路由 SSL 问题
- r - 绘图图:在 R 中计数 x 小时
- node.js - React 应用程序在多个异步图像下载时重新加载
- node.js - Node.js Lambda 函数中的 AWS S3 ListObjects
- ms-access - 使用 VB6 连接到 Access 2013 数据库
- java - 我正在尝试公开一个 ArrayList(在 java 中),以便我可以在不同的类中访问它,我做错了什么?
- python - pip install 失败“找不到满足要求的版本”
- sql - 计算客户购买商品的平均价格
- angular - 使用 Injectable service 洞察另一个 Injectable service angular 5
- mysql - msql 将每个类别中的项目计数为 2 列,按状态与连接