Y
Y
Yerasyl07n2021-11-05 08:15:33
Building projects
Yerasyl07n, 2021-11-05 08:15:33

How to compile a file into an exe using Pyinstaller?

I made my project (minecraft) on Ursina Engine in Python:

The code
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController

class Voxel(Button):
    def __init__(self, position =(0,0,0)):
        super().__init__(
            parent = scene,
            position = position,
            model = "cube",
            origin_y = 0.5,
            texture = "white_cube",
            color = color.white,
            highlight_color = color.lime)

    def input(self, key):
        if self.hovered:
            if key == "left mouse down":
                voxel = Voxel(position = self.position + mouse.normal)

            if key == "right mouse down":
                destroy(self)

app = Ursina()

for z in range(20):
    for x in range(20):
        voxel = Voxel(position = (x,0,z))

player = FirstPersonController()

window.fullscreen = True
window.color = color.black
window.fullscreen_size = 1920,1080

app.run()


(in some places, spaces were not put in the code when I published the entry, it happened),
but when I want to compile it into an EXE through Pyinstaller, after which I open the dist folder and find the file itself there, I have it called Bulid3D1.2. I am getting this error:

Error text
Traceback (most recent call last):
File "Bulid3D1.2.py", line 23, in
File "ursina\main.py", line 27, in __init__
File "direct\showbase\ShowBase.py", line 339, in __init__
File "direct\showbase\ShowBase.py", line 1021, in openDefaultWindow
File "direct\showbase\ShowBase.py", line 1056, in openMainWindow
File "direct\showbase\ShowBase.py", line 766, in openWindow
File "direct\showbase\ShowBase.py", line 752, in
File "direct\showbase\ShowBase.py", line 818, in _doOpenWindow
File "direct\showbase\ShowBase.py", line 648, in makeDefaultPipe
File "direct\directnotify\Notifier.py", line 130, in error
Exception: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.


can i use another compiler in exe? I tried to solve this problem by searching the Internet, but usually this error occurs in Panda3D, and I did not find anything about Ursina. and it's strange that the error says "Your Config.prc file must name at least one valid panda display library via load-display or aux-display" and what about Panda itself?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lerto, 2021-11-06
@Lerto

Can: pyinstaller -F Buil3D1.2.py

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question