Converting python script to Window binary

edited August 2021 in Python scripting

I built a simple viewer using klayout (pip module) and pysimplegui. In order to distribute it, MS Window binary (EXE file) was created using pyinstaller. But, it failed with an error message -- "RuntimeError: Stream has unknown format: (filename) in Layout.read". After hours of trying with different options, I finally get it working with following option. Is this the right way to build EXE? What about others' experience on this?

pyinstaller --onefile --add-data "(path to site-packages)\klayout\db_plugins;.\db_plugins" mymain.py

Comments

  • @yangwoo I have not used the .exe builder, but the important point is to place the "db_plugins" folder with all the stream file drivers next to "dbcore.so" (or whatever the native db library is called in your case).

    When this shared object/DLL loads it will search for stream drivers next to it's own installation site in a folder called "db_plugins". Hence this folder needs to be there.

    I don't know if that is the effect of the mentioned option.

    Matthias

  • Sorry for late reply. You're rigth. db_plugins folder should be added. Then everything is OK.

Sign In or Register to comment.