[Solved] packp3d not able to import EggData etc.

Hey all, sorry for bothering again. If all goes well this will hopefully be the last question you hear from me for a while (:

I’ve coded my program, packaged it using packp3d and everything works until it reaches the section using the code from here. When running it through the python interpreter everything works correctly. However, when running it using panda3d after being packaged, it says that it cannot find the required libraries, spefically panda3d.egg which I imported to use EggData, EggVertexPool, EggVertex, EggGroup, EggLine , loadEggData and EggNurbsCurve.

To replicate this problem simply copy the code from that thread, package it and then try to run it.

I thought a way to fix the code would be replace imports from panda3d.core and panda3d.egg with the equivalent ones from pandac.PandaModules, however when importing by name (“from pandac.PandaModules import EggData”) it again packages fine but it throws up the following when run:

ImportError: cannot import name EggData

If I use “from pandac.PandaModules import *” then it packages fine and runs, until the part of the code that uses EggData is called, causing it to crash.

I think this might just be me not including a directory using “-p” in packp3d but I can’t figure out which one I should be specifying, especially as far as I knew pandac.PandaModules should be included by default anyway. Would I be able to solve it if I explicitly included panda3d.core and panda3d.egg, if so how would I go about doing that?

Many thanks in advance!

The egg library is one of the optional packages for the p3d system. Use “-r egg” on the packp3d command line to include it.

And you should be importing from panda3d.egg; the pandac.PandaModules form is deprecated and should not be used in new code. :slight_smile:

David

David, again, you solve my problem in a timely, concisely and pleasant manner. Thanks :slight_smile: