using pfreeze

I want to make a standalone exe file for my game in panda. I tried py2exe with no luck and now I heard about pfreeze utility of panda3d So I wanted some info about how to use pfreeze. I typed python pfreeze.py -o game.exe “C:…\main.py” but that does nothing except printing usage.

I’ll appriciate any help from anyone regarding pfreeze or py2exe.

PS: using py2exe I get the error “ImportError: Cannot find libpandaexpress.dll”

Have you considered packp3d and pdeploy? The Panda’s manual contains very detailed descriptions of them.

Ok, I read about them and I think they can be nice but I am getting an impression that when I run pdeploy, with -s option, It will download panda3d libraries for all platforms so tell me what libraries it needs to download? don’t we have the libraries if we have the game engine :laughing: ? And it tells if I use -s option, my setup size will be large, I don’t want it to be too large. And what use is not using -s option? the amount end user will have to download will still be roughly same.

someone told me rdb knows how to use pfreeze. rdb, can you tell me about it?

pfreeze is not a complete solution for packaging up your application; it’s just a small part of the whole packp3d and pdeploy solution. But you might be thinking of packpanda, which was the earlier tool that we provided before we had pdeploy. packpanda uses py2exe to correctly package up your Python-based Panda3D program into a standalone exe file.

Note that pdeploy is also supposed to do the same thing, only more effectively. It’s a newer tool and does have a few issues, but downloading multiple copies of the game libraries is not one of them.

David

I’ve used packpanda but as far as I know, It creates a setup file which upon extracting, gives the user the python file(or pyc). what py2exe did for me in a gui application(made using easygui) is to provide me a single executable with some libraries leaving no sign of what language I used. And finally I ended up with a setup.exe file(made using nsis and then UPX) of 3.5 mb. I want a similar kind of operation by packpanda or packp3d or py2exe or anything else on a game in panda3d.

I’ve tried py2exe but the resulting executable is giving me an error “ImportError: Cannot find libpandaexpress.dll” :cry:

No, packpanda creates an executable file, using py2exe, with all of the Python code bundled up within the executable.

It is also possible to use py2exe directly, but you have to set up the scripts to locate the Panda3D DLL’s (as you have discovered). This is basically what packpanda does for you. Packpanda is just a thin wrapper around py2exe.

David

Maybe this is not true: py2exe inserts your (“compiled”) main script file as a resource into the executable, and the (“compiled” versions of) other scripts into a file named library.zip. So, it “leaves more than a sign” about the language you used.

yaio: yes, as a programmer I agree to you but as an end-user I don’t know why that looks more natural to me. In py->exe->setup method I think I have more options to provide and I think size will be less(but I’m not sure abt this).

David: maybe you are right(as I’m sure you are not wrong). And yes, I think I’ll need help on instructing the interpreter to include panda’s dlls. currently I’m following thread: [url]using py2exe , Panda3d and Python 2.4] but I’ll appriciate any additional help.

Well, using the thread of Smriti Sharma, I was able to include all dlls. but still when I run the executable, I get the following error :

any help on that?

Well, I figured that out myself. thanks anyways. But I think now i can atleast choose which dlls and packages not to include in my library.zip because I know what packages I’m using. So it does reduce size, doesn’t it? :laughing:

But pdeploy already does this same logic, and can share dll’s between other Panda applications–it won’t need to redownload a DLL if another Panda application has already downloaded it.

But I’m not going to tell you what system to use. If you’re happy with py2exe, go ahead and use it.

David

Just clarifying this on request - this is only true if you run pdeploy in “standalone” mode. If you use pdeploy’s “installer” mode, it should be self-contained and not share anything with other applications.