pdeploy creating silent exe

Hi,
I use panda3d to develop a small app for initiation in basic astronomy:
astrini.science-trotter.com
Panda3d seems the perfect engine for my discovery of 3d game programming.
I only have troubles distributing.

The standalones generated by pdeploy do not work on every MS windows. They download and install panda runtime on first execution, but then nothing happens and calling the exe again does nothing (not even a print when called in DOS). I’ve seen this on win7 and win8 but only some of them.

I use pdeploy like this:

pdeploy -s -n astrini -N "Astrini" -v 0.1 -a glen_lomax \
    -A "Glen Lomax" -e g@g.com -l "GNU Public License" \
    -L license.txt -i images/icon.png -P win32 \
    Astrini.p3d standalone

the p3d generated with:

ppackage packagedef.py

and packagedef is:

import sys
# add the working directory to the path so local files and modules can be found
sys.path.insert(0,'')

class Astrini(p3d):
    require('panda3d', 'numpy') # include some other packages

    config(display_name="Astrini") 

    #module('core.*') # include the python package core, and its submodules
    module('astronomia')
    dir('fonts',newDir='fonts') # include font files
    dir('models',newDir='models')
    dir('images',newDir='images')
    mainModule('main') # include and set the main module that runs when the p3d is run
    file('license.txt') # include text files
    file('README')

This works perfectly fine on most windows installations, but not all…
I’ve tried the installer version (it installs but then the astrini.exe installed is also silent).
I’ve tried to pack with pdeploy on windows XP and windows 7 but it makes no difference either.

I wonder how to investigate as there is no output from the failing startup of the proram. How to make it more verbose ?

For information,
I run and pack with:
Panda3d SDK 1.8.1
Panda3d runtime 1.0.4

Can you post the log file contents?

Sorry, I feel too much a newbie but where should I find this logfile ?
The standalone exe remains silent and creates no log file in its running directory.
The installer version creates no log in its program files directory.

I really don’t have any clues about how to get an output !

It should be in a sub-directory of the Panda runtime directory, which should be described on this page, I believe.

Thanks A LOT !
Finally, I have some clues :slight_smile:
Seems to be related to the calendar module in the python std lib (searching for an enigmatic aliases module)… shouldn’t it be managed by the included python in panda3d ? Or should I force the inclusion of some modules ?

Here is the log about the failed launched of astrini :

:AppRunner: Total Panda3D disk space used: 162 MB
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 45, in <module>
  File "VFSImporter", line 153, in load_module
  File "Scene.py", line 11, in <module>
  File "VFSImporter", line 153, in load_module
  File "c:\python27\lib\calendar.py", line 10, in <module>
  File "locale", line 16, in <module>
ImportError: No module named aliases
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 638, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 502, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 460, in step
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 45, in <module>
  File "VFSImporter", line 153, in load_module
  File "Scene.py", line 11, in <module>
  File "VFSImporter", line 153, in load_module
  File "c:\python27\lib\calendar.py", line 10, in <module>
  File "locale", line 16, in <module>
ImportError: No module named aliases
Failure on startup.
Command line: "C:\Program Files (x86)\Astrini\panda3d\cmu_1.8\p3dpythonw.exe" "C:\Program Files (x86)\Astrini/panda3d/cmu_1.8/panda3d.cmu_1.8.win32.mf" "00000130" "00000140" "0"
Created splash window 002A043E
Loaded image: C:\Program Files (x86)\Astrini/images/download.png
notify: onpluginload 
notify: onauth 
notify: ondownloadbegin 
notify: ondownloadcomplete 
notify: onready 
application shares main object
notify: onpythonload 
notify: onpythonstop 
finish_instance: 021F68B8
Assigning 021F68B8->log_pathname = C:\Users\Pierre\AppData\Local/Panda3D/log/Astrini.log

packp3d/ppackage omits some Python standard library modules by default. By using “-r morepy” on the packp3d command-line (or as an additional ‘require’ in the pdef file), you include those other modules as well. Could you try that?

Thank you all for helping in my invetigation, Panda3d community is really respnsive :slight_smile:

I’ve updated my packdef:

import sys
# add the working directory to the path so local files and modules can be found
sys.path.insert(0,'')

class Astrini(p3d):
    # we need numpy and ALL std lib (morepy)
    require('panda3d', 'numpy', 'morepy')

    config(display_name="Astrini") 

    #module('core.*') # include the python package core, and its submodules
    module('astronomia')
    #~ dir('astronomia',newDir='astronomia')
    dir('fonts',newDir='fonts') # include font files
    dir('models',newDir='models')
    dir('images',newDir='images')
    mainModule('main') # include and set the main module that runs when the p3d is run
    file('license.txt') # include text files
    file('README')

requiring morepy solves the problem above :slight_smile:
but now the log complains when trying to load numpy :frowning:

:AppRunner: Total Panda3D disk space used: 182 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 34, in <module>
  File "VFSImporter", line 446, in load_module
ImportError
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 638, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 502, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 460, in step
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 34, in <module>
  File "VFSImporter", line 446, in load_module
ImportError
Failure on startup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Setting working directory: C:\Users\Soham\AppData\Local\Panda3D\start
Command line: "C:\Users\Soham\AppData\Local\Panda3D\hosts\runtime.panda3d.org_0f5faf88846080ae\panda3d\cmu_1.8\p3dpythonw.exe" "C:\Users\Soham\AppData\Local/Panda3D/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.8/panda3d.cmu_1.8.win32.mf" "000000B4" "000000C0" "0"
Created splash window 00090186
notify: onpluginload 
notify: onauth 
notify: ondownloadbegin 
notify: ondownloadcomplete 
notify: onready 
notify: onpythonstop 
finish_instance: 01779980
Assigning 01779980->log_pathname = C:\Users\Soham\AppData\Local/Panda3D/log/astrini.log

line 34 in main.py is:

import numpy

strange as its supposed to be loaded by panda and that the runtime installs numpy rev 1 on first execution…

Do you have any idea why the import doesn’t work ?

Hmm, no, I’m afraid I don’t. There may be a bug in the packaging system.

To pursue the quest of identifying this bug, I’ve made a minimal piece of code to reproduce the import error.

My main is :

#!/usr/bin/env python
# -*- coding: utf-8-*- 
import numpy

#a virtual argument to bypass packing bug
def main(arg=None):
    print 'running'

my pack definition (packdef.py):

#!/usr/bin/env python
# -*- coding: utf-8-*- 
#
class Test(p3d):
    require('numpy', 'morepy') #VFSImport error

    mainModule('main') # include and set the main module that runs when the p3d is run

Then I do:

ppackage packagedef.py

and:

pdeploy -s -P win32 Test.p3d standalone

This exe produces this log :

:AppRunner: Total Panda3D disk space used: 182 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 3, in <module>
  File "VFSImporter", line 446, in load_module
ImportError
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 638, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 502, in run
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\task\Task.py", line 460, in step
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 424, in __taskChainDispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\showbase\Messenger.py", line 482, in __dispatch
  File "C:\buildslave\release_rtdist_win32\build\panda3d\built_cmu\direct\p3d\AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "main.py", line 3, in <module>
  File "VFSImporter", line 446, in load_module
ImportError
Failure on startup.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Setting working directory: C:\Users\Soham\AppData\Local\Panda3D\start
Command line: "C:\Users\Soham\AppData\Local\Panda3D\hosts\runtime.panda3d.org_0f5faf88846080ae\panda3d\cmu_1.8\p3dpythonw.exe" "C:\Users\Soham\AppData\Local/Panda3D/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.8/panda3d.cmu_1.8.win32.mf" "000000B4" "000000C0" "0"
Created splash window 001703E0
notify: onpluginload 
notify: onauth 
notify: ondownloadbegin 
notify: ondownloadcomplete 
notify: onready 
notify: onpythonstop 
finish_instance: 01779980
Assigning 01779980->log_pathname = C:\Users\Soham\AppData\Local/Panda3D/log/Test.log

I presume the bug is in panda3d deploying tools. Something about the interaction between numpy and morepy subpackages. Indeed, If we replace

require('numpy', 'morepy') #VFSImport error

by

require('numpy') #start and full cpu

the program loads nicely and prints ‘running’ as expected. The log looks fine:

:AppRunner: Total Panda3D disk space used: 182 MB
:AppRunner: Configured max usage is: 2048 MB
running
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  Setting working directory: C:\Users\Soham\AppData\Local\Panda3D\start
Command line: "C:\Users\Soham\AppData\Local\Panda3D\hosts\runtime.panda3d.org_0f5faf88846080ae\panda3d\cmu_1.8\p3dpythonw.exe" "C:\Users\Soham\AppData\Local/Panda3D/hosts/runtime.panda3d.org_0f5faf88846080ae/panda3d/cmu_1.8/panda3d.cmu_1.8.win32.mf" "000000B4" "000000C0" "0"
Created splash window 001D0216
application shares main object
notify: onpluginload 
notify: onauth 
notify: ondownloadbegin 
notify: ondownloadcomplete 
notify: onready 
notify: onpythonload 
Downloading https://runtime.panda3d.org/contents.xml?1422815587: 44.6%, 0182ACB0
Downloaded https://runtime.panda3d.org/contents.xml?1422815587: 100%, 0182ACB0, success = 1
release_temp_filename: C:\Users\Soham\AppData\Local\Temp\p3d_181ac0.xml
All 8 extracts of images seem good.
report_package_info_ready: images
Done installing images: success = 1
image_filename = C:\Users\Soham\AppData\Local/Panda3D/hosts/runtime.panda3d.org_0f5faf88846080ae/images/download.png, thread_id = 3096
Loaded image: C:\Users\Soham\AppData\Local/Panda3D/hosts/runtime.panda3d.org_0f5faf88846080ae/images/download.png
notify: onpythonstop 
finish_instance: 01829980
Assigning 01829980->log_pathname = C:\Users\Soham\AppData\Local/Panda3D/log/Test.log

The strange thing is that this simple program prints and then remains using a full cpu… but well, that’s something else to care about.

How would you proceed to pack a program depending on numpy and the calendar module of python standard library ?

Is there any way to pack a module without using the ‘require’ method ?

Looks like it may be related to this bug:
bugs.launchpad.net/panda3d/+bug/1148559

There seems to be a work-around mentioned in the comment on the bug report.

Thanks,
indeed it seems related but the workaround involves modifying numpy if I get it.

I’ve managed to solve my problem by changing packdef.py

#!/usr/bin/env python
# -*- coding: utf-8-*- 
#

#Tune panda packing

import sys
# add the working directory to the path so local files and modules can be found
sys.path.insert(0,'')

class Astrini(p3d):
    # we need numpy
    require('panda3d', 'numpy')

    config(display_name="Astrini")
    
    # modules from standard lib needed and not included in panda
    module('encodings.aliases')
    # custom module for ephemeris
    module('astronomia')
    dir('fonts',newDir='fonts') # include font files
    dir('models',newDir='models')
    dir('images',newDir='images')
    mainModule('main') # include and set the main module that runs when the p3d is run
    file('license.txt') # include text files
    file('README')

i’ve added ‘module(‘encodings.aliases’)’ for my ‘calendar’ usage.

The package seems to launch now :slight_smile:

Great, glad you solved it!

I’ve learned important things about deploying in the process. Many thanks to you all !
Keep strong Panda3d !