I am trying to make a portable python vtk reader with pyInstaller. All tested computers have the same OS (windows 7 SP1) but on most of them it doesn’t work.
Here is a test script named “VTK-TEST.py” (a simple vtk window containing a single slider):
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
iren = vtk.vtkRenderWindowInteractor()
Using the following command to make a pyInstaller distribution:
it produces a folder containing all kind of vtk and python related files and one .exe executable.
Putting the distribution on an USB key, it works on some computers but not others (all with same OS) and I am trying to understand why.
When the produced distribution doesn’t work, launching the .exe results in the following error:
ModuleNotFoundError: no module named ‘vtkCommonKitPython’
(despite the fact that a file named vtkCommonKitPython.pyd is included in the distribution)
I tried edditing the .spec file line: hiddenimports=[‘vtk’], to be sure all vtk dependencies are exported, but using the dist built by the following command, it still doesn’t change anything.
I’ve tried doing the same for other simple scripts and tkinter scripts, those distributions work on all our computers as long as vtk is not involved.
I am guessing vtk distributions work or not depending on softwares allready installed on the computer, but I cannot find a common denominator. I would like the distribution to work without having to install anything as much as possible.
I suppose I am missing some tags in the .spec file that would make the vtk distribution work, I ll be grateful if you can help me.
edit I shall specify that I use python 3.7, vtk 8.1.2 and pyInstaller 3.4