I have the following directory structure in my project:
src/ main.py game/ __init__.py scene.py scenes/ __init__.py test.py
In main.py, I have this line near the top:
from game.scenes.test import Test
That works when I do: python -c “import main”
However, once I use packp3d to create the .p3d file and run the p3d via panda3d runtime, I get this error:
... File "VFSImporter", line 153, in load_module File "C:\Users\Josh\Dev\blah\src\main.py", line 6, in <module> from game.scenes.test import Test ImportError: No module named scenes.test Failure on startup.
Why does this code work outside of the p3d? What can I do to fix this?