I’m using OS X El Capitan and have been unable to setup panda3D on my Macbook Pro.
Running this line from the examples, or the hello world tutorial:
from direct.showbase.ShowBase import ShowBase
Makes python 2.7.10 quit unexpectedly, and crashes.
My Python path contains ‘/Developer/Panda3D’, and I have tried adding ‘/Developer/Panda3D/bin’ to it as well to see if that helps, but it did not.
I started playing around with it to try and trace back the error, and I found that these commands do not cause errors:
>>> from direct import showbase >>> import panda3d >>> from panda3d import *
These commands cause python to crash
>>> from direct.showbase import ShowBase >>> from direct.showbase.ShowBase import * >>> from panda3d import core >>> from panda3d import physics >>> from panda3d import direct
Importing something that clearly does not exist however, such as when I tried:
from panda3d import fnajkpng
Does not make it crash like that, just prints the error, so it appears to be finding the files, but failing to use them.
So it seems to crash whenever it tries to import anything from ‘Panda3D/panda3d’. The files in there are all modules with a .so extension that I am unfamiliar with, but after googling it I saw something someone posted about how you need to import a .so and it isn’t working you can try including something like from the same directory as the .so:
def __bootstrap__(): global __bootstrap__, __loader__, __file__ import sys, pkg_resources, imp __file__ = pkg_resources.resource_filename(__name__,'direct.so') #or whatever the filename __loader__ = None; del __bootstrap__, __loader__ imp.load_dynamic(__name__,__file__) __bootstrap__()
This also crashes, and when run from terminal gives the error “ImportError: dynamic module does not define init function (init__main__)”. Googling that found nothing that I could directly make use of, but appeared to indicate that this error is associated with python modules written in c/c++ that are not implemented correctly to be used as a python module.
If someone could please point me in the right direction as to how to solve this, that would be great. Probably half the things I wrote down in here aren’t useful, but I included everything I have found out. I also checked basic stuff like, is my default python the same as that used in IDLE, and I believe it is. Thank you for your help.