[GH-ISSUE #243] pygame zero exe not working #217

Closed
opened 2026-02-26 12:20:51 +03:00 by kerem · 10 comments
Owner

Originally created by @ghost on GitHub (Feb 19, 2022).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/243

Hi

I'm an autistic girl trying to make exe from a pygame zero code.
Is it possible to read here my problem?
I only have this problem with pygame zero games, not with pygame games.
I don't know what to do because I also don't understand this weird error about an icon I don't even use in my code! :-(

https://github.com/lordmauve/pgzero/issues/283

Thx

Originally created by @ghost on GitHub (Feb 19, 2022). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/243 Hi I'm an autistic girl trying to make exe from a pygame zero code. Is it possible to read here my problem? I only have this problem with pygame zero games, not with pygame games. I don't know what to do because I also don't understand this weird error about an icon I don't even use in my code! :-( https://github.com/lordmauve/pgzero/issues/283 Thx
kerem 2026-02-26 12:20:51 +03:00
  • closed this issue
  • added the
    Stale
    label
Author
Owner

@brentvollebregt commented on GitHub (Feb 23, 2022):

Is much more helpful when the error is here:

Traceback (most recent call last):
File "tigerheli.py", line 2, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "pgzrun.py", line 23, in
File "pgzero\runner.py", line 106, in prepare_mod
File "pgzero\game.py", line 92, in show_default_icon
File "pkgutil.py", line 639, in get_data
File "PyInstaller\loader\pyimod03_importers.py", line 344, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\GEBRUI~1\AppData\Local\Temp\_MEI183602\pgzero\data\icon.png'
<!-- gh-comment-id:1048522889 --> @brentvollebregt commented on GitHub (Feb 23, 2022): Is much more helpful when the error is here: ``` Traceback (most recent call last): File "tigerheli.py", line 2, in File "", line 1027, in _find_and_load File "", line 1006, in _find_and_load_unlocked File "", line 688, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "pgzrun.py", line 23, in File "pgzero\runner.py", line 106, in prepare_mod File "pgzero\game.py", line 92, in show_default_icon File "pkgutil.py", line 639, in get_data File "PyInstaller\loader\pyimod03_importers.py", line 344, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\GEBRUI~1\AppData\Local\Temp\_MEI183602\pgzero\data\icon.png' ```
Author
Owner

@brentvollebregt commented on GitHub (Feb 23, 2022):

It looks like the application you are bundling is looking for icon.png however it has not been included in the additional data.
Most likely this file.

<!-- gh-comment-id:1048523443 --> @brentvollebregt commented on GitHub (Feb 23, 2022): It looks like the application you are bundling is looking for icon.png however it has not been included in the additional data. Most likely [this file](https://github.com/lordmauve/pgzero/blob/master/pgzero/data/icon.png).
Author
Owner

@ghost commented on GitHub (Feb 23, 2022):

How to solve this in auto-py-to-exe?

Because a pygame game is converted perfectly, but not a pygame zero game.

<!-- gh-comment-id:1049002924 --> @ghost commented on GitHub (Feb 23, 2022): How to solve this in auto-py-to-exe? Because a pygame game is converted perfectly, but not a pygame zero game.
Author
Owner

@brentvollebregt commented on GitHub (Feb 24, 2022):

Check out "FileNotFoundError: [Errno 2] No such file or directory" in the help post I have written - you will need to add the file manually using the "Additional Files" section in the UI. This is not an issue with auto-py-to-exe.

<!-- gh-comment-id:1049558035 --> @brentvollebregt commented on GitHub (Feb 24, 2022): Check out "[FileNotFoundError: [Errno 2] No such file or directory](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/#filenotfounderror-errno-2-no-such-file-or-directory)" in the help post I have written - you will need to add the file manually using the "Additional Files" section in the UI. This is not an issue with auto-py-to-exe.
Author
Owner

@ghost commented on GitHub (Feb 24, 2022):

Hi

I selected "Additional Files" and then "Add Files" and I have chosen the icon.png

Now the error is changed to this So it has another folder but still can't find the file.

The folder in the error is now the folder where the EXE was written: F:\Visual Studio project\PYTHON\DreamSoft Games\output\tigerheli

pygame 2.1.2 (SDL 2.0.18, Python 3.10.1)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "tigerheli.py", line 2, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module
File "pgzrun.py", line 23, in
File "pgzero\runner.py", line 106, in prepare_mod
File "pgzero\game.py", line 92, in show_default_icon
File "pkgutil.py", line 639, in get_data
File "PyInstaller\loader\pyimod03_importers.py", line 344, in get_data
FileNotFoundError: [Errno 2] No such file or directory: 'F:\Visual Studio project\PYTHON\DreamSoft Games\output\tigerheli\pgzero\data\icon.png'
[16572] Failed to execute script 'tigerheli' due to unhandled exception!

<!-- gh-comment-id:1050300687 --> @ghost commented on GitHub (Feb 24, 2022): Hi I selected "Additional Files" and then "Add Files" and I have chosen the icon.png Now the error is changed to this So it has another folder but still can't find the file. The folder in the error is now the folder where the EXE was written: F:\Visual Studio project\PYTHON\DreamSoft Games\output\tigerheli pygame 2.1.2 (SDL 2.0.18, Python 3.10.1) Hello from the pygame community. https://www.pygame.org/contribute.html Traceback (most recent call last): File "tigerheli.py", line 2, in <module> File "<frozen importlib._bootstrap>", line 1027, in _find_and_load File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 688, in _load_unlocked File "PyInstaller\loader\pyimod03_importers.py", line 495, in exec_module File "pgzrun.py", line 23, in <module> File "pgzero\runner.py", line 106, in prepare_mod File "pgzero\game.py", line 92, in show_default_icon File "pkgutil.py", line 639, in get_data File "PyInstaller\loader\pyimod03_importers.py", line 344, in get_data FileNotFoundError: [Errno 2] No such file or directory: 'F:\\Visual Studio project\\PYTHON\\DreamSoft Games\\output\\tigerheli\\pgzero\\data\\icon.png' [16572] Failed to execute script 'tigerheli' due to unhandled exception!
Author
Owner

@brentvollebregt commented on GitHub (Feb 25, 2022):

Have you put the file in the right place? In the help post I supply, I states:

For files that have been included but this error is still showing, package to one-directory instead of one-file to make sure things are working.

Have you used one-directory mode to check if the file is in the right place?

<!-- gh-comment-id:1050631201 --> @brentvollebregt commented on GitHub (Feb 25, 2022): Have you put the file in the right place? In the [help post I supply](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/), I states: > For files that have been included but this error is still showing, package to one-directory instead of one-file to make sure things are working. Have you used one-directory mode to check if the file is in the right place?
Author
Owner

@ghost commented on GitHub (Feb 25, 2022):

Is it possible to tell me step by step what to do?

  • I have the file, in what folder do I copy it? Do I have to copy it to a subfolder \pgzero\data ?

  • What option(s) I have to choise in auto-py-to-exe?

I can't find it, I keep getting error

<!-- gh-comment-id:1051011597 --> @ghost commented on GitHub (Feb 25, 2022): Is it possible to tell me step by step what to do? - I have the file, in what folder do I copy it? Do I have to copy it to a subfolder \pgzero\data ? - What option(s) I have to choise in auto-py-to-exe? I can't find it, I keep getting error
Author
Owner

@brentvollebregt commented on GitHub (Feb 25, 2022):

When adding a file or folder in auto-py-to-exe, there are two boxes to fill out: the source location and the destination.

  • The source location is where the file currently is on your disk. Using "Add Files" or "Add Folder" will auto-populate this field for you.
  • The destination is where the file/folder will be put inside the final executable/folder. For example, if you have a file called icon.png and your code expects it to be in the folder "assets/images/" relative to your script, then you should put in "assets/images/".
<!-- gh-comment-id:1051314701 --> @brentvollebregt commented on GitHub (Feb 25, 2022): When adding a file or folder in auto-py-to-exe, there are two boxes to fill out: the source location and the destination. - The source location is where the file currently is on your disk. Using "Add Files" or "Add Folder" will auto-populate this field for you. - The destination is where the file/folder will be put inside the final executable/folder. For example, if you have a file called icon.png and your code expects it to be in the folder "assets/images/" relative to your script, then you should put in "assets/images/".
Author
Owner

@github-actions[bot] commented on GitHub (Apr 27, 2022):

This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment on this issue or it will be closed in 5 days.

<!-- gh-comment-id:1110432560 --> @github-actions[bot] commented on GitHub (Apr 27, 2022): This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment on this issue or it will be closed in 5 days.
Author
Owner

@github-actions[bot] commented on GitHub (May 3, 2022):

Closing issue due to no activity in more than 60 days.

<!-- gh-comment-id:1115526165 --> @github-actions[bot] commented on GitHub (May 3, 2022): Closing issue due to no activity in more than 60 days.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#217
No description provided.