Question

As the title should suggest, I am having some problems. I am using Pygame and Python 3.3, and when trying to run my compiled script it spits out a black screen, and no error in console. This program works in Idle, but will not work in the EXE

Here is my setup.py

from cx_Freeze import setup, Executable


exe=Executable(
     script="BackedGrid.py",
     base="Win32Gui",
     )

includes=[]
excludes=[]
packages=[]
setup(
     version = "1.0",
     description = "None",
     author = "Brandon Danyluk",
     name = "Backed Grid",
     executables = [exe]
     )

If you have any questions about my main program, please do ask. I am not good at providing details without any questions. Thanks!

Était-ce utile?

La solution

I had issues when compiling my program with cx_freeze and pygame as well. The fix I used was to add this to my main code:

try:
    import pygame._view
except:
    pass

For some reason it needs this module however only in exe form. If you try to import pygame._view normally it will throw an error. I have no idea if your setup file is correct either. I just used the basic one and filled in the areas etc. Ask any questions below.

Also see this question here and the other problem is here.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top