[GH-ISSUE #198] Error #178

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

Originally created by @cpstest-tech on GitHub (Oct 2, 2021).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/198

Hello, I am trying to use this app for converting my Ursina Game Engine Project, will attach the settings that i used and the output
pyinstaller --noconfirm --onedir --windowed --icon "D:/Download/1608658_cube_icon.ico" --add-data "C:/Users/Paolo/PycharmProjects/MinecraftPythonEdition/assets;assets/" "C:/Users/Paolo/PycharmProjects/MinecraftPythonEdition/Mineceraft.py"
image
image
Code of the game:
`from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController

app = Ursina()
grass_texture = load_texture('assets/grass_block.png')
stone_texture = load_texture('assets/stone_block.png')
brick_texture = load_texture('assets/brick_block.png')
dirt_texture = load_texture('assets/dirt_block.png')
sky_texture = load_texture('assets/skybox.png')
punch_sound = Audio('assets/punch_sound',loop = False, autoplay = False)
block_pick = 1

window.fps_counter.enabled = True
window.exit_button.visible = False

def update():
global block_pick
if held_keys['1']: block_pick = 1
if held_keys['2']: block_pick = 2
if held_keys['3']: block_pick = 3
if held_keys['4']: block_pick = 4

class Voxel(Button):
def init(self, position = (0,0,0), texture = grass_texture):
super().init(
parent = scene,
position = position,
model = 'assets/block',
origin_y = 0.5,
texture = texture,
color = color.color(0,0,random.uniform(0.9,1)),
scale = 0.5)

def input(self,key):
    if self.hovered:
        if key == 'left mouse down':
            punch_sound.play()
            if block_pick == 1: voxel = Voxel(position = self.position + mouse.normal, texture = grass_texture)
            if block_pick == 2: voxel = Voxel(position = self.position + mouse.normal, texture = stone_texture)
            if block_pick == 3: voxel = Voxel(position = self.position + mouse.normal, texture = brick_texture)
            if block_pick == 4: voxel = Voxel(position = self.position + mouse.normal, texture = dirt_texture)

        if key == 'right mouse down':
            punch_sound.play()
            destroy(self)

class Sky(Entity):
def init(self):
super().init(
parent = scene,
model = 'sphere',
texture = sky_texture,
scale = 150,
double_sided = True)

for z in range(48):
for x in range(32):
voxel = Voxel((x,0,z))

player = FirstPersonController()
sky = Sky()

app.run()`
The game works perfectly if ran with python, but when converted it gives me those errors

Originally created by @cpstest-tech on GitHub (Oct 2, 2021). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/198 Hello, I am trying to use this app for converting my Ursina Game Engine Project, will attach the settings that i used and the output `pyinstaller --noconfirm --onedir --windowed --icon "D:/Download/1608658_cube_icon.ico" --add-data "C:/Users/Paolo/PycharmProjects/MinecraftPythonEdition/assets;assets/" "C:/Users/Paolo/PycharmProjects/MinecraftPythonEdition/Mineceraft.py"` ![image](https://user-images.githubusercontent.com/68495386/135719537-c7e06381-6499-4d79-9846-a07ff9fba45c.png) ![image](https://user-images.githubusercontent.com/68495386/135719547-f9d69a91-6b9d-4acd-8f0c-939e532e48ac.png) Code of the game: `from ursina import * from ursina.prefabs.first_person_controller import FirstPersonController app = Ursina() grass_texture = load_texture('assets/grass_block.png') stone_texture = load_texture('assets/stone_block.png') brick_texture = load_texture('assets/brick_block.png') dirt_texture = load_texture('assets/dirt_block.png') sky_texture = load_texture('assets/skybox.png') punch_sound = Audio('assets/punch_sound',loop = False, autoplay = False) block_pick = 1 window.fps_counter.enabled = True window.exit_button.visible = False def update(): global block_pick if held_keys['1']: block_pick = 1 if held_keys['2']: block_pick = 2 if held_keys['3']: block_pick = 3 if held_keys['4']: block_pick = 4 class Voxel(Button): def __init__(self, position = (0,0,0), texture = grass_texture): super().__init__( parent = scene, position = position, model = 'assets/block', origin_y = 0.5, texture = texture, color = color.color(0,0,random.uniform(0.9,1)), scale = 0.5) def input(self,key): if self.hovered: if key == 'left mouse down': punch_sound.play() if block_pick == 1: voxel = Voxel(position = self.position + mouse.normal, texture = grass_texture) if block_pick == 2: voxel = Voxel(position = self.position + mouse.normal, texture = stone_texture) if block_pick == 3: voxel = Voxel(position = self.position + mouse.normal, texture = brick_texture) if block_pick == 4: voxel = Voxel(position = self.position + mouse.normal, texture = dirt_texture) if key == 'right mouse down': punch_sound.play() destroy(self) class Sky(Entity): def __init__(self): super().__init__( parent = scene, model = 'sphere', texture = sky_texture, scale = 150, double_sided = True) for z in range(48): for x in range(32): voxel = Voxel((x,0,z)) player = FirstPersonController() sky = Sky() app.run()` The game works perfectly if ran with python, but when converted it gives me those errors
kerem 2026-02-26 12:20:44 +03:00
  • closed this issue
  • added the
    Stale
    label
Author
Owner

@brentvollebregt commented on GitHub (Oct 3, 2021):

Potentially a file Config.prc has not been packaged and is expected? Judging by this, another library may be providing it - however since it's not imported using the import keyword, PyInstaller does not package it.

I would recommend copying this file, reference it explicitly in your code (it seems you can tell it where to look) and then include this file as an additional file. Make sure to test using a debugger before you package to an exe.

However, this seems to be library-specific so I cannot offer much help sorry - you will need to investigate with the library being used.

<!-- gh-comment-id:932901951 --> @brentvollebregt commented on GitHub (Oct 3, 2021): Potentially a file `Config.prc` has not been packaged and is expected? Judging by [this](https://discourse.panda3d.org/t/config-prc/6763), another library may be providing it - however since it's not imported using the `import` keyword, PyInstaller does not package it. I would recommend copying this file, reference it explicitly in your code (it seems you can tell it where to look) and then include this file as an additional file. Make sure to test using a debugger before you package to an exe. However, this seems to be library-specific so I cannot offer much help sorry - you will need to investigate with the library being used.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 3, 2021):

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:985119707 --> @github-actions[bot] commented on GitHub (Dec 3, 2021): 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 (Dec 8, 2021):

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

<!-- gh-comment-id:988388509 --> @github-actions[bot] commented on GitHub (Dec 8, 2021): 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#178
No description provided.