0

I make a game by using python 2.7.11, I use cxFreeze to creat the exe file to make sure others can play it on other computers. But something disturbs me. I cann't let the pygame modules link to the testspeed.exe. My python edition is 32bit, and the pygame module is 32bit too. The IDE is pycharm. All things about python is in the C:\ , only testspeed.py in the E:\ Please help me!

This is the setup.py code:

import sys
from cx_Freeze import setup, Executable

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"], "excludes":  ["Tkinter","Pygame"]}

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

setup(  name = "testspeed",
        version = "0.1",
        description = "test your speed!--lcy",
        options = {"build_exe": build_exe_options},
        executables = [Executable("testspeed.py", base=base)])

I type code like this in commandline:

python setup.py bdist_msi 

But something happend:

This is the picture(I don't have enough reputation to post more than 2 links):

enter image description here

PS: I use google ,find someone use the include command , but I can't understand the method to let the pygame become a exe file.

Cyril Lou
  • 21
  • 1
  • 3
  • I don't think pygame is supposed to be captalized – SirParselot Feb 05 '16 at 16:29
  • OK.But I use the “pygame” ,it doesn't work too.@SirParselot – Cyril Lou Feb 05 '16 at 16:34
  • Why do you want pygame to be an exe? When you create the installer it will create a .pyc file for each of your modules and pygame should be contained in that. I think you need to take pygame out of the excluded options. If you use Tkinter in your program then you need to take that as well. If it doesn't add pygame then youll have to include it – SirParselot Feb 05 '16 at 16:46
  • As @SirParselot said: you're *excluding* pygame from the build, and your executable complains that it can't find pygame. If the code needs it, don't exclude it. – Thomas K Feb 07 '16 at 09:15

0 Answers0