首页 > 解决方案 > Mac 上的 PyVisa 和 Agilent 823578

问题描述

我正在尝试让 PyVisa 在我的 Mac 上运行。我已经安装了它和NI 库,但是当我尝试在 VS 代码中从终端运行以下简单的 python 文件时:

import sys
import pyvisa as visa
rm = visa.ResourceManager()
rm.list_resources()

inst = rm.open_resources('GPIB::10::INSTR') #Instrument GPIB Addr = 10
print (inst.query("*IDN?"))

通过运行“python3 temp.py”,我收到以下错误消息:

Error Domain=KMErrorDomain Code=71 "Insufficient permissions for action: Unable to load 'com.highpoint-tech.kext.HighPointRR' in unprivileged request." UserInfo={NSLocalizedDescription=Insufficient permissions for action: Unable to load 'com.highpoint-tech.kext.HighPointRR' in unprivileged request.}
zsh: abort      python3 temp.py

标签: python-3.xusbvisapyvisagpib

解决方案


确保com.ni.driver.NiViPciK已安装并加载扩展程序。为此,请转到关于本机 -> 系统报告 -> 扩展(在软件部分)并找到 NiViPciK。它可能会说“已加载:否”。您需要手动允许 National Instruments 扩展。

  1. 开机时按住 Cmd-R 进入恢复模式。
  2. 从工具菜单打开终端。
  3. 执行:spctl kext-consent add SKTKK2QZ74
  4. 重启

这对我有用: 在此处输入图像描述


推荐阅读