Search code examples
pythonmacosgame-enginepanda3d

Panda 3D Python import error on OSX


I have been messing around with Python/Panda3D and trying to get my first file to run. I am on OSX and after installing Panda3D I tried to run this file:

import direct.directbase.DirectStart
run()

That was followed by this on the Terminal output:

$ python core.py 
Traceback (most recent call last):
  File "core.py", line 2, in <module>
    import direct.directbase.DirectStart
ImportError: No module named direct.directbase.DirectStart

I have been searching everywhere, but all the forms don't really solve the problem. Any help would be awesome!

Thanks!


Solution

  • This is usually a problem when you're using a version of Python other than the one Panda3D is compiled with. If you are using the 1.9.0 Lion build of Panda3D, make sure you are using the system-provided copy of Python 2.7, by explicitly running "python2.7" or "ppython" (which should be a symlink to the correct version of Python).