i have problem with ursina when it get compiled to exe

Question:

I started creating a shooter game with ursina, and I tried to get exe from this using pyinstaller. after I got the exe, when I run the app, it show me an error(o
I have coded a new game with ursina, but
I got this:

Traceback (most recent call last):
  File "main.py", line 5, in <module>
  File "ursinamain.py", line 28, in __init__
  File "directshowbaseShowBase.py", line 339, in __init__
  File "directshowbaseShowBase.py", line 1024, in openDefaultWindow
  File "directshowbaseShowBase.py", line 1059, in openMainWindow
  File "directshowbaseShowBase.py", line 769, in openWindow
  File "directshowbaseShowBase.py", line 749, in <lambda>
  File "directshowbaseShowBase.py", line 821, in _doOpenWindow
  File "directshowbaseShowBase.py", line 650, in makeDefaultPipe
  File "directdirectnotifyNotifier.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.

my code:

from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
from ursina.shaders import lit_with_shadows_shader

app = Ursina()

ground = Entity(model='plane', collider='box', scale=64, texture='grass', texture_scale=(4,4))

editor_camera = EditorCamera(enabled=False, ignore_paused=True)
player = FirstPersonController()


for i in range(16):
    Entity(model='cube', origin_y=-.5, scale=2, texture='brick', texture_scale=(1,2),
        x=random.uniform(-8,8),
        z=random.uniform(-8,8) + 8,
        collider='box',
        scale_y = random.uniform(2,3),
        color=color.hsv(0, 0, random.uniform(.9, 1))
        )

cube = Entity(model='cube',color=color.red,scale=3)

def update():
    cube.rotation_x = cube.rotation_x + 15
    cube.rotation_y = cube.rotation_y + 5


# Enemy()

sun = DirectionalLight()
sun.look_at(Vec3(1,-1,-1))
Sky()

app.run()

Can somebody please help me???

Asked By: Arash

||

Answers:

So, I got the answer from one of the friends here.

to build it, you need to open the terminal and type:

$ python -m ursina.build

And when you do, this will create a folder called "build", open it and open the "PROJECNAME.BAT" file to start the game!
Answer from DiamondsBattle and thanks to everybody!

Answered By: Arash
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.