Ubuntu 22.04下pyVISA报VI_ERROR_NPERMISSION错误的解决办法
无法在Linux Ubuntu 22.04下通过Python与Newport ESP300运动控制器通信
我在Linux机器上使用Python 3.10尝试连接Newport ESP300运动控制器,USB或串口连接均失败。
环境搭建过程:从Ubuntu 22.04.3 LTS最小化纯净安装开始,安装NI驱动ni-ubuntu2204-drivers-2023Q4.deb和NI-VISA,安装过程无报错。安装pyVISA并创建ResourceManager后,仅得到33个ASRLx::INSTR端口列表;使用pyMeasure列出资源时,同样显示这些端口,但每个端口都重复出现如下错误:
0 : ASRL1::INSTR : Visa IO Error: check connections
VI_ERROR_NPERMISSION (-1073807192): Access to the resource or remote machine is denied. This is due to lack of sufficient privileges for the current user or machine
我的pyvisa-info信息(所有Python包均安装在虚拟环境中):
(practice) physix@physix-Latitude-E7470:~$ pyvisa-info Machine Details: Platform ID: Linux-6.2.0-37-generic-x86_64-with-glibc2.35 Processor: x86_64 Python: Implementation: CPython Executable: /home/physix/Projects/practice/bin/python3 Version: 3.10.12 Compiler: GCC 11.4.0 Architecture: ('x86', 64) Build: Nov 20 2023 15:14:05 (#main) Unicode: UCS4 PyVISA Version: 1.14.1 Backends: ivi: Version: 1.14.1 (bundled with PyVISA) #1: /usr/lib/x86_64-linux-gnu/libvisa.so.23.8.0: found by: auto architecture: ('x86', 64) Vendor: National Instruments Impl. Version: 24119296 Spec. Version: 7340032 py: Version: 0.7.1 ASRL INSTR: Available via PySerial (3.5) USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1 USB RAW: Available via PyUSB (1.2.1). Backend: libusb1 TCPIP INSTR: Available Resource discovery: - VXI-11: ok - hislip: ok TCPIP SOCKET: Available VICP INSTR: Please install PyVICP to use this resource type. 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 functionalities. No module named 'gpib' GPIB INTFC: 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 functionalities. No module named 'gpib'
截至目前,我已尝试以下方法但均未成功:
- 执行
sudo chmod 777 /dev - 执行
sudo usermod -a -G tty physix - 执行
echo 'SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"' >> /etc/udev/rules.d/99-com.rules - 执行
sudo udevadm trigger - 将
hostname -I的输出添加至VISA配置的安全允许访问列表
内容的提问来源于stack exchange,提问作者Earthling75
相关产品推荐
相关产品推荐

