简体   繁体   中英

Pyinstaller Codec Error on Executable When Using No Console And No Debug Option

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM