1

I am trying to allow people to play my pygame game through an executable by using cx_Freeze. When I launch 'main.exe' the game launches as normal and I can navigate through the menu screens of the game ('Instructions' and 'Customisation'). However, when I click 'Play' the game crashes and the command prompt shows the error: NotImplementedError: Can't perform this operation for unregistered loader type.

I am not sure what I should post in terms of code, so please feel free to ask for any.

Any help would be much appreciated!

Edit: setup.py

import cx_Freeze

executables = [cx_Freeze.Executable("main.py"), cx_Freeze.Executable("main_menu.py"), cx_Freeze.Executable("sprites.py"), cx_Freeze.Executable("customisation_screen.py"), cx_Freeze.Executable("leaderboard.py"), cx_Freeze.Executable("game_over_menu.py"), cx_Freeze.Executable("settings.py"), cx_Freeze.Executable("text.py")]

cx_Freeze.setup(
    name = "Comets",
    options = {"build_exe": {"packages":["pygame"],
                             "include_files":["F:/AH Computing Project/Comets/img/",
                                              "F:/AH Computing Project/Comets/sound/"]}},
    executables = executables

    )
  • Certainly you need to include your setup script and some minimal code that will reproduce the problem. (maybe a working "play" function that produces that effect.) – Xantium Mar 04 '18 at 10:38
  • @Simon I have included the setup script. I don't really have a 'play' function per se, 'main.py' runs and accesses the other python files when required. So in the case of pressing 'Play', the 'game_intro()' loop within 'main_menu.py' ends and 'main.py' keeps running where it left off. I don't really see how there could be an error with the code itself when it all worked perfectly fine before it was compiled :/ – G Macaskill Mar 04 '18 at 11:03
  • No it is your setup script probably but without knowing how you inplamented your code it is extremely difficult to answer. How long is the code, could you condense it? Without being actually able to run both finding a solution is extremely difficult. – Xantium Mar 04 '18 at 11:08
  • You're running an older version of python, 3.4 is there anything stopping you from updating? Are you running the latest version of cx-Freeze? – import random Mar 06 '18 at 01:46

0 Answers0