Panda3D Module Import Failure on Mac OS 10.14 Mojave

I’m having a lot of difficulty getting Panda3D setup on my newish Mac. I’ve used Panda successfully many times in the past, but the new install location seems to be creating some issues for me.

Error seen going through tutorial:

Traceback (most recent call last):
  File "panda_hello.py", line 3, in <module>
    from direct.showbase.Showbase import ShowBase
ModuleNotFoundError: No module named 'direct.showbase.Showbase'

I installed Panda3D today. I checked every box during the install (all python version and C headers included). Panda seems to be installed at both /Developer/Panda3D and /Library/Developer/Panda3D.

When I run the samples from the samples folder in either of the Panda3D directories, the sample games run successfully.

However, when I run my test helloworld project located on my desktop I get the error above.

Steps I have taken so far:

Added Panda3D folder to PATH
Added Panda3D folder to PYTHONPATH
Tried running with python
Tried running with python3
Tried reinstalling Panda3D
Tried pip3 installing Panda3D
(Requirement already satisfied: panda3d in /usr/local/lib/python3.8/site-packages (1.10.6.post2))

Perhaps I’m missing something obvious, but I’ve searched all over and I can’t find a solution that will allow my python to find these Panda packages. Does anyone have advice?

Hi, welcome to the community!

Sorry to hear about your troubles. Please try these commands in the Python interpreter and share the result:

import sys
print(sys.path)
import direct
print(direct.__file__)
import panda3d
print(panda3d.__file__)

Python 3.8.5 (default, Jul 21 2020, 10:42:08)

[Clang 11.0.0 (clang-1100.0.33.17)] on darwin

import sys
print(sys.path)

[‘’, ‘/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python38.zip’, ‘/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8’, ‘/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload’, ‘/usr/local/lib/python3.8/site-packages’, ‘/Library/Developer/Panda3D’]

import direct
print(direct.file)

/usr/local/lib/python3.8/site-packages/direct/init.py

import panda3d
print(panda3d.file)

/usr/local/lib/python3.8/site-packages/panda3d/init.py

Looks like I had a typo in my original import (Showbase instead of ShowBase). But hey, at least I learned a few things on the way. Thanks for your help.