How to make exe of my panda game with py2exe?

Hello,

I’am new panda user and I don’t know how to make exe of my panda
game with py2exe, when I try to do it with this code:

Setup script

import py2exe
form distutils.core import setup
setup(windows=[“mygame.py”]

I get this error:

No module name direct.directbase.DirectStart

…I’am working on windows XP SP2 and Python 2.5.

Sorry for my bad english! :frowning:

Regards,
Vedran

This thread has the answer, thanks to ynjh_jo:
discourse.panda3d.org/viewtopic.php?t=3579

Hello again,

Thanks for previous help, I have found so much great informations like this setup script ( I made a few changes ):

…after I run this script:

I get this error:

Here is the whole cmd output:

This is the script that I want to convert to exe:

Sorry for my bad english :frowning: and google translator :wink: .

Appreciate any help!

Regards,
Vedran :slight_smile:

Use the last script on that thread by ynjh_jom. The one you have half works…I think all that it is missing is the dlls (and etc and manifest) though.

Hello again,

I was try with this script but I still get the same error, I’m not good with these microsoft product.I know that I have .NET framework 2.0 and Microsoft C++ redistributable installed on my PC.Do I need to install anything else? :confused: :confused:

Regards,
Vedran

panda3d comes with many of its dll in the bin folder … some of them must be present in order to run your game. Which ones beets me so copy all of them.

It’s not that. Your py2exe installation is messed up !

There should be build_exe.py in py2exe folder.

Hello,

…everything was ok with py2exe installation! Now everything works properly,
I did the following:

1)Copied all the content from C:\Python25\Lib to library.zip
2)Copied modules: inspect,dis and opcode to library.zip
3)Copied all the content from C:\Panda3D-1.5.2\direct\src to library.zip/direct and comment the lines in __init__py

Now library.zip have more then 70 mb, but there is no problem cause now
everything works properly! :smiley: :smiley: :smiley: :smiley:

Sorry for my bad english and thank you all!!! :slight_smile: :slight_smile:

Regards,
Vedran

ynjh_jom’s script should work without any extra needed copying? Are you using panda’s python or python25?

Hello,

…python25.

Regards,
Vedran

That’s probably the reason. Panda3D comes with its own copy of python. You don’t need a separate python installed, and sometimes stuff can get confused over which version to choose. If it chooses the separate python, that means it won’t be able to find panda’s modules without extra effort.