Cannot access PySpin system instance with Windows executable (created with pyinstaller)

2.1k views Asked by At

I'm trying to create an executable on Windows 10 from a python app which takes camera images using Spinnaker and its PySpin wrapper. The first step is to acquire the PySpin "System" instance. I can successfully run this python script from the command line

import PySpin
syst = PySpin.System.GetInstance()

But after creating an executable using pyinstaller script.py I get the following exception upon running it:

_PySpin.SpinnakerException: Spinnaker: System instance cannot be acquired. [-1012]

Somehow the executable cannot acquire the System instance. I tried running it as adminstrator, without luck. I have pyinstaller installed via conda.

1

There are 1 answers

0
Cheng-Wei Gu On

I had the same issue, but I had have solved the problem by coping the following .xml files from “…\Anaconda3...\Lib\site-packages\PySpin” to the same location of script.exe. Everything goes smoothly after that work.

SFNC_GenTLDataStream_Usb3_Version_1_0_0_Schema_1_1.xml SFNC_GenTLDevice_Reference_Version_1_0_0_Schema_1_1.xml SFNC_GenTLDevice_Usb3_Version_1_0_0_Schema_1_1.xml SFNC_GenTLInterface_Reference_Version_1_0_0_Schema_1_1.xml SFNC_GenTLInterface_Usb3_Version_1_0_0_Schema_1_1.xml SFNC_GenTLSystem_Version_1_0_0_Schema_1_1.xml