0

I create a little GUI interface to work with Keysight stuff.

I use Python 3.6.4, PyVisa 1.8 (both x64), setuptools 19.2

When i create exe-file by PyInstaller it's all builded whithout any errors.

And when a run application it's all good.

But when i run it into another machine (win7x64, without python, pyvisa, etc... stuff) it's doesn't work by OSError: Could not open VISA library

enter image description here

enter image description here

How can i packed up my application and pyvisa stuff into one piece?

""" Main body """
import sys, time, visa, interface
from PyQt5 import QtCore, QtWidgets, QtGui

RM = visa.ResourceManager("C:/Windows/System32/visa32.dll")
#RM = visa.ResourceManager()
KEYSIGHT = RM.open_resource('TCPIP0::10.11.0.200::inst0::INSTR')
...
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Ezk13
  • 17
  • 4

1 Answers1

1

PyVisa wraps the NI Visa library, but that library must be installed separately because it is an NI product. PyInstaller has no way of bundling this because Pyvisa does not bundle it.

That said, I expect that if you install NI Visa library on your target PC, your software will work. You'll need to advise users that NI Visa is a dependency they'll need to install themselves.

three_pineapples
  • 11,579
  • 5
  • 38
  • 75
  • 1
    I thnk i get it. I installed NI-VISA Run-Time Engine 17.0 and it will work! Thanks! – Ezk13 Jan 18 '18 at 08:17
  • 1
    @Ezk13 Yep, that's what I meant! If my answer has solved your problem, please mark it as accepted by clicking the tick mark on the left hand side. Thanks! – three_pineapples Jan 18 '18 at 20:43
  • @three_pineapples You might not have received an answered question check from Ezk13, but you certainly helped me. Thank you! – Nick Aug 29 '18 at 18:50
  • Is it possible to add ni488.dll to the executable using the add-data option that is described in this post? https://stackoverflow.com/questions/38791685/how-do-i-include-dll-file-in-executable-using-pyinstaller – Sanjo May 21 '23 at 16:23
  • @Sanjo Maybe, but it's (a) likely to not be the only file needed and (b) I suspect doing so would likely violate some sort of NI license agreement. – three_pineapples May 29 '23 at 11:44
  • Good point about the license agreement - I'll avoid that method. – Sanjo May 30 '23 at 14:31