I'm making this program that uses imageio and imageio-ffmpeg, I want to turn it into an executable, so I entered the virtualenv environment I'm using for the project, generated the .spec with pyi-makespec
, and after trying for a long time, I got it working by adding this into the binaries
section of the .spec file:
binaries=[("C:\\Users\\me\\video_env\\Lib\\site-packages\\imageio_ffmpeg", "imageio_ffmpeg"), ("C:\\Users\\me\\video_env\\Lib\\site-packages\\imageio", "imageio")],
Then I changed console
and debug
to True
, and I generated the executable. And it works. Now that everything was working, I changed console
and debug
to False
again, generated the executable, and this time it no longer works. The program opens correctly, but when it reaches the place that uses imageio, it crashes and I get this error window from pyinstaller:
Just to be sure, I turned on console
and debug
again, and sure enough, it works again:
It also works if I have debug=False
and console=True
, but it doesn't work with debug=True
and console=False
. Am I making a mistake with the binares? I have no idea how to fix this, please help me.
I found out why it wasn't working, it's a bug in pyinstaller. It worked when I used the development version of pyinstaller. I ran pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip
in cmd, and ran the pyinstaller command again, and it worked.