0

So I was using cx_Freeze in order to turn my python script using ursina into an executable but then this happened : Error

What am I supposed to do?

This is what my folder content and setup.py file looked like when I had the error : Content

Onuelito
  • 21
  • 3
  • [Please do not upload images of code/errors when asking a question](//meta.stackoverflow.com/q/285551), please paste the error message as text into your question instead. Please also add relevant information to your question (e.g. Python version, cx_Freeze version, imports of your application, cx_Freeze setup script, ...) – jpeg Aug 18 '21 at 07:43

2 Answers2

0

Try to add 'ursina' to the packages list of the build_exe_options in the setup.py script.

EDIT: try also to add src to the include_files list of the build_exe_options:

build_exe_options = {'packages': ['ursina'], 'include_files': ['src']}

# ...

setup(  name = ...,  # complete!
        ...
        options = {'build_exe': build_exe_options},
        executables = [Executable(...)])

See the cx_Freeze documentation for further details.

jpeg
  • 2,372
  • 4
  • 18
  • 31
0

From the original Ursina engine's folder copy the application.py file and in the build folder, you will find exe.win-amd64-3.9 folder , inside that there will be a folder named lib, inside that there will be ursina folder you have to paste it here (if you are using default download location then this is the application.py's path: C:\Users\welcome\AppData\Local\Programs\Python\Python39\lib\site-packages\ursina\application.py)

George Z.
  • 6,643
  • 4
  • 27
  • 47
red
  • 1
  • 1