Overview
When converting Python sample programs provided with the eBUS SDK (such as PvStreamSample.py or PvPipelineSample.py) into standalone .exe files using PyInstaller, users may experience unexpected termination of the application at runtime.
For example, the application may exit at the following line:
Cause
This issue occurs because GenICam DLL files are not included in the runtime environment by default. These files are essential for the application to run properly and must be explicitly bundled when creating the .exe file.
Solution
To avoid this problem, use the following PyInstaller command to ensure all necessary dependencies are included:
Example command:
Explanation of options:
-
--hidden-import numpy: The eBUS Python wrapper usesnumpyinternally, so it must be explicitly included. -
--add-binary: Includes the GenICam folder, which contains essential DLLs. The format is"source_path;destination_path". -
--onefile: Packages everything into a single executable for easier distribution(Optional).
Additional Tips
-
Ensure that the GenICam path matches the installation location on your machine.
-
If you use additional modules in your script, you may need to include more
--hidden-importor--add-binaryoptions.
Summary
To successfully convert Python eBUS SDK samples into .exe files, it is crucial to include GenICam DLLs using PyInstaller’s --add-binary option. Failing to do so will lead to runtime errors or unexpected termination.
Comments
0 comments
Please sign in to leave a comment.