Create a package

I have been playing around with packp3d and managed to create some .p3d files. But now, I am trying to create some packages but I cannot make it work.
Inside C:/Temp I have created a package definition file: mypackage.def

import sys
class mypackage(package):

Inside C:/Temp/src/ I have created a module called

class test():
	def __init__(self):
		print "Hello"

When I run the next command:
ppackage -i c:/Temp/Panda3DPackages c:/Temp/mypackage.pdef

I get the next error in the command window:

Any suggestion on what I am doing wrong?


I get the following error when I follow your steps:

Unknown module: src.test

This is because you are specifying a module from the “src” package even though there is no “src” package, since you didn’t create an in the src directory.

It’s a bit weird to have a package named “src”, which makes me suspect you meant to add “src” to sys.path and instead just add the “test” module, which would work too.

Hi rdb,
The problem was that I named the definition file ‘mypackage.def’ and not ‘mypackage.pdef’. The python file was placed in the subdir src, so that was ok.
I found the issue 2 days ago but did not have time to login in the forum until now.
Thanks anyway!