I have not been able to successfully get py2exe to work on other computers, I have been stuck at the .libs not loading correctly…
It will work on a computer that has panda installed however
What I have done: look in your panda install directory, under “direct”. Copy everything from the src folder in that directory up one (inside direct). Comment all of the lines in the init.py file. Use this setup script:
from distutils.core import setup
import py2exe
import os,sys
PANDA_DIR = 'C:\Panda3D-1.4.2/'
setup( console = [ { 'script' : 'test.py',
#'icon_resources' : [ ( 1, 'game.ico' ) ],
} ],
#zipfile = None,
options = { 'py2exe': { 'optimize' : 2,
'excludes' : [ 'Tkinter' ],
'dist_dir' : 'dist/'},
},
data_files = [ ( 'etc', [ os.path.join(PANDA_DIR, 'etc/Config.prc'), ] ),
],
packages = [
'direct',
'direct.directbase',
'direct.showbase',
'direct.interval',
'direct.actor',
'direct.gui',
'direct.task',
'direct.controls',
'direct.directnotify',
'direct.directtools',
'direct.directutil',
'direct.fsm',
'direct.cluster',
'direct.particles',
'direct.tkpanels',
'direct.tkwidgets',
'direct.directdevices',
'direct.distributed',
'pandac',
],
package_dir = {
'direct' : os.path.join(PANDA_DIR, 'direct'),
'direct.directbase' : os.path.join(PANDA_DIR, 'direct/directbase'),
'direct.showbase' : os.path.join(PANDA_DIR, 'direct/showbase'),
'direct.interval' : os.path.join(PANDA_DIR, 'direct/interval'),
'direct.actor' : os.path.join(PANDA_DIR, 'direct/actor'),
'direct.gui' : os.path.join(PANDA_DIR, 'direct/gui'),
'direct.task' : os.path.join(PANDA_DIR, 'direct/task'),
'direct.control' : os.path.join(PANDA_DIR, 'direct/control'),
'direct.directnotify' : os.path.join(PANDA_DIR, 'direct/directnotify'),
'direct.directtools' : os.path.join(PANDA_DIR, 'direct/directtools'),
'direct.directutil' : os.path.join(PANDA_DIR, 'direct/directutil'),
'direct.fsm' : os.path.join(PANDA_DIR, 'direct/fsm'),
'direct.cluster' : os.path.join(PANDA_DIR, 'direct/cluster'),
'direct.particles' : os.path.join(PANDA_DIR, 'direct/particles'),
'direct.tkpanels' : os.path.join(PANDA_DIR, 'direct/tkpanels'),
'direct.tkwidgets' : os.path.join(PANDA_DIR, 'direct/tkwidgets'),
'direct.directdevices' : os.path.join(PANDA_DIR, 'direct/directdevices'),
'direct.distributed' : os.path.join(PANDA_DIR, 'direct/distributed'),
'pandac' : os.path.join(PANDA_DIR, 'pandac'),
},
)
This will get you to an error something like "failed to load the dll properly from pylibexpress.pyo…good luck! Please show us how you did it!