py2exe

squeakypants

08-04-2007 00:29:24

The tutorial here doesn't work. It can't find the dlls in ...Python25\Lib\site-packages\Ogre. How do I set it up so that it knows where they are?

Game_Ender

08-04-2007 03:52:59

That tutorial is not for Python-Ogre and I have marked it as such with the new version Python-Ogre version tag template to prevent confusion until its updated. PyOgre and Python-Ogre are packaged differently so you will most likely need a different set of parameters for py2exe, sorry I don't know what they are :(

squeakypants

08-04-2007 19:29:34

Right :) I'll try to figure it out. I'll post on the wiki if I do.

scriptkid

09-04-2007 11:00:28

Hi,

i needed to add the site-packaged to my path. I use this real-life batchfile containing:
PATH=%PATH%;C:\Python25\lib\site-packages\Ogre
c:\python25\python setup.py py2exe
copy dist\*.* ..\bin\*.* /Y
copy stringtable.dat ..\bin\ /Y
del ..\bin\ogre.log
del ..\bin\cegui.log
del ..\bin\dinput8.dll

My setup.py contains this:
from distutils.core import setup
import py2exe
setup(console=['snake.py'])

Good luck! :)

squeakypants

09-04-2007 21:41:18

it doesn't copy anything with that, since there's no bin folder...

scriptkid

11-04-2007 08:26:06

Well i just posted my working batchfile. The most important lines are these:
(change the Python location if it's different on your system!)

PATH=%PATH%;C:\Python25\lib\site-packages\Ogre
c:\python25\python setup.py py2exe


I have created a 'helper' bin directory to which i copy over new 'dist' stuff, because i found out that py2exe does not put all modules into 'dist', iirc one or more cegui files and something else ;)

But i read in the newsgroup that this issue might have been fixed. I will find out soon since i am upgrading from 0.7 now...

HTH.

bharling

11-04-2007 09:57:09

if you're creating an exe for distribution you can use


from distutils.core import setup
import py2exe
setup(windows=['snake.py'])


instead of

setup(console=['snake.py'])


That will get rid of the console window, no good for debug but nicer for a release.

scriptkid

11-04-2007 10:58:41

Nice hint, thanks :) I never looked in detail to these few lines yet ;)