pythonpyvisa

PyVisa Binary Library Not Found


Binary Library: Not Found Error.

I am running from Git Bash with Windows 10 and using pip to install packages.

I installed Ni-VISA from their website and the pyVISA and pyVISA-py packages.
I have the visa32.dll and visa64.dll in C:\Windows\System32.

I have tried installed the development version of pyvisa-py. Did not work. My Paths under Windows' "System Variables" are identical to those on another machine that works correctly.

Thanks in advance for the help. I'm embarrassed to say how much time I've spent on this.

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

The Path using Python in terminal and "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']

I expect to have

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

Solution

  • Finally, figured it out.

    In the directory C:\Users[username], create or modify the .pyvisarc file (this is a unique file extension). Then add the following text inside which points to your visa32.dll :

    [Paths]
    
    VISA library: C:/Windows/System32/visa32.dll
    

    Syntax is important. Also, restart the terminal if you're using to just to be safe and then the python -m visa info terminal command should display the expected NI backend.

    Here's link to the documentation for other systems