1

When i tried to open my .exe file which is created using pyinstaller ,its showing failed to execute pyiboot01_bootstrap. I created a simple pygame, which contain audio, image and some code.

Command i used to create my .exe file was

pyinstaller main.py --noconsole --debug all

1 Answers1

1

I would suggest using --onefile argument also. Since your game contains images and audio files the most probable problem is that you have not moved your .exe from dist folder to the folder where is your main.py so the paths to those images and audio files are incorrect. And if you have not already, update pygame to 2.0.0.dev6 or dev8, because from personal experience pygame 1.9.6 in certain cases cause error when audio files are present. These steps should solve the issue.

EDIT: Answer on comment

Oh, I did not know that you used font. 2 possible fixes, had the same issue. First use some "standard" fonts like "Arial".

font = pg.font.SysFont("Arial", FONT_SIZE, True)

or put the font you want to use (freesansbold.ttf) in the same folder as .exe First option will work for sure.

kaktus_car
  • 986
  • 2
  • 11
  • 19
  • yah, i tried with `--onefile`, and i already have the latest version of pygame.But still the same – badhusha muhammed Jul 20 '20 at 12:47
  • Ok, did you move the file so the paths stay correct? Also try removing audio file, only leave image, see if it is going to work. I searched about this error, maybe it has to do with "exiting". See [this](https://stackoverflow.com/questions/56957022/pyinstaller-failed-to-execute-script-pyiboot01-bootstrap) – kaktus_car Jul 20 '20 at 12:51
  • Bro, when i remove the font that i used in my code, it is working properly, `font = pygame.font.Font("freesansbold.ttf", 32))`.How to fix this..? – badhusha muhammed Jul 20 '20 at 13:02