Weirdo in ppackage [solved]

buddies

A weird error when i use ppackage to make (wow) packages for my p3d app.

my .pdef …

from pandac.PandaModules import Filename

packager.setHost("http://localhost/bb/")
class bbGMaker (package):
	module('babilonia.guimaker.*')

The error message tells…

:Packager: Reading bbGMaker.pdef
couldn't import babilonia.guimaker
couldn't import babilonia
Traceback (most recent call last):
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 352, in __taskChainDispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 410, in __dispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\p3d\AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/ppackage.py", line 200, in <module>
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 2245, in readPackageDef
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 2270, in __evalFunc
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 2703, in do_module
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 2713, in addModule
  File "C:\panda3d-1.7.0\built_cmu\direct\showutil\FreezeTool.py", line 770, in addModule
  File "C:\panda3d-1.7.0\built_cmu\direct\showutil\FreezeTool.py", line 701, in getModuleStar
  File "C:\panda3d-1.7.0\built_cmu\direct\showutil\FreezeTool.py", line 671, in getModulePath
ImportError: No module named babilonia

no module named babilonia! but babilonia is in the pythonpath, in sys.path and i can access it in every python code i got :open_mouth:
Whatta Hell ? :angry:

What is babilonia, specifically? Is it a directory containing an init.py file, is it a babilonia.py file, or is it a babilonia.pyd file, or is it something else altogether?

David

babilonia is a folder with a init.py

babilonia´s tree is :

- babilonia
   __init__.py
   - guimaker
     __init__.py
     GuiMaker.py

What happens if you explicitly import babilonia in your pdef file, using an import command?

David

David

ImportError again :frowning:. Really … this is not normal. I really can call babilonia in everywhere in my pc without a ImportError.

My path…

['', 'C:\\Python26\\Lib', 'C:\\Python26\\Lib\\site-packages', 'C:\\Panda3D-1.7.0
', 'C:\\Windows\\system32\\python26.zip', 'C:\\Python26\\DLLs', 'C:\\Python26\\l
ib\\plat-win', 'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Panda3D-1.7.0\\
bin', 'C:\\Users\\master\\Desktop\\Babilonia_GAME', 'C:\\Users\\master\\Desktop\
\Babilonia_GAME\\babilonia', 'C:\\Users\\master\\Desktop\\ptestes', 'C:\\Python2
6\\lib\\site-packages\\win32', 'C:\\Python26\\lib\\site-packages\\win32\\lib', '
C:\\Python26\\lib\\site-packages\\Pythonwin', 'C:\\Python26\\lib\\site-packages\
\wx-2.8-msw-unicode']

WeIrDo :unamused:

For testing purposes i copy babilonia to same folder where pdefs files in. ppackage runs smooth, my packages are imported fine, everybody is in peace in Camelot and in p3dapp. But weird still in the air… :wink:

Of course someone cant see somebody in the paths … but i have no idea… :unamused:

Cheers

Remember that ppackage runs its own version of Python, and it may not read your PYTHONPATH variable. What do you see if you print sys.path within your pdef file?

David

Hey … how to remember something you never heard before :laughing:
But you´re right man see…

C:\Users\Germano\AppData\Local\Panda3D\hosts\runtime.panda3d.org_96a0ec538744def6\panda3d\cmu_1.7
C:\Users\Germano\AppData\Local/Panda3D/hosts/runtime.panda3d.org_96a0ec538744def6/egg/cmu_1.7
C:\Users\Germano\AppData\Local/Panda3D/hosts/runtime.panda3d.org_96a0ec538744def6/panda3d/cmu_1.7
C:\Users\Germano\AppData\Local\Panda3D\hosts\runtime.panda3d.org_96a0ec538744def6\panda3d\cmu_1.7\python26.zip
C:\Python26\Lib
C:\Python26\DLLs
C:\Python26\Lib\lib-tk
C:\Python26\Lib
C:\Python26\DLLs
C:\Python26\Lib\lib-tk
C:\Users\Germano\AppData\Local\Panda3D\hosts\runtime.panda3d.org_96a0ec538744def6\panda3d\cmu_1.7
/mf

But how could i change the PYTHONPATH of ppackage? This is possible? I must append path by path in sys.path? Use a .pth file?

Thanx

Edit sys.path in the top of your pdef file, like this:

import sys
sys.path.append('/my/special/directory')

David

Gotcha man!
Thanx ++