python-3.xusbvisapyvisagpib

PyVisa and Agilent 823578 on Mac


I am trying to get PyVisa working on my mac. I have installed it and NI libraries but when I try to run the following simple python file from terminal in VS code:

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?"))

By running 'python3 temp.py' I get the following error message:

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

Solution

  • Make sure com.ni.driver.NiViPciK extension is installed and loaded. For this, go to About This Mac -> System Report -> Extensions (in Software section) and find NiViPciK. It will likely say "Loaded: No". You need to manually allow National Instruments extensions.

    1. Boot into recovery mode by holding Cmd-R while powering up.
    2. Open Terminal from Tools menu.
    3. Execute: spctl kext-consent add SKTKK2QZ74
    4. Reboot

    This did the trick for me: enter image description here