首页 > 解决方案 > 将 PyVISA 与 PyVISA-Py 后端一起使用时出现问题:PyUSB 似乎没有正确安装

问题描述

我通过 pip安装PyVISA、、、PyVISA-Py和打包PyUSBlibusb但它仍然说pyUSB没有正确安装。并且资源管理器无法列出桌面上的任何 USB 设备。我还在桌面上安装了NI-VISA,它也无法列出 USB 设备。

In [1]: import pyvisa

In [2]: rm = pyvisa.ResourceManager()

In [3]: rm.list_resources()
Out[3]: ('ASRL1::INSTR', 'ASRL3::INSTR')

In [4]: rm = pyvisa.ResourceManager('@py')

In [5]: rm.list_resources()
Out[5]: ()

命令窗口中的信息:

(base) C:\Users\zhang>pyvisa-info
Machine Details:
   Platform ID:    Windows-10-10.0.19041-SP0
   Processor:      Intel64 Family 6 Model 58 Stepping 9, GenuineIntel

Python:
   Implementation: CPython
   Executable:     c:\users\zhang\anaconda3\python.exe
   Version:        3.8.3
   Compiler:       MSC v.1916 64 bit (AMD64)
   Bits:           64bit
   Build:          Jul  2 2020 17:30:36 (#default)
   Unicode:        UCS4

PyVISA Version: 1.11.3

Backends:
   ivi:
      Version: 1.11.3 (bundled with PyVISA)
      #1: C:\WINDOWS\system32\visa32.dll:
         found by: auto
         bitness: 64
         Vendor: National Instruments
         Impl. Version: National Instruments
         Spec. Version: National Instruments
      #2: C:\WINDOWS\system32\visa64.dll:
         found by: auto
         bitness: 64
         Vendor: National Instruments
         Impl. Version: National Instruments
         Spec. Version: National Instruments
   py:
      Version: 0.5.1
      ASRL INSTR:
         Please install PySerial (>=3.0) to use this resource type.
         No module named 'serial'
      USB INSTR:
         PyUSB does not seem to be properly installed.
         Please refer to PyUSB documentation and
         install a suitable backend like
         libusb 0.1, libusb 1.0, libusbx,
         libusb-win32 or OpenUSB.
         No backend available
      USB RAW:
         PyUSB does not seem to be properly installed.
         Please refer to PyUSB documentation and
         install a suitable backend like
         libusb 0.1, libusb 1.0, libusbx,
         libusb-win32 or OpenUSB.
         No backend available
      TCPIP INSTR: Available
      TCPIP SOCKET: Available
      GPIB INSTR:
         Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of funcionality.
         No module named 'gpib'

标签: pyusbpyvisa

解决方案


推荐阅读