Panda3D and Eclipse under MacOS X...

Perhaps this isn’t a proper ‘installation’ question, but it does involve setting up and using Panda3D. I apologize in advance if it is misplaced.

Anyway, I’ve apparently installed Panda3D successfully; I’m able to access it via the command line and to run most of the various demos. However, I have not been able to get Eclipse (using PyDev) to build anything using it. I’ve set up my PYTHONPATH and such so that Eclipse can find the package but it fails to run. For example, the first tutorial will run correctly from outside Eclipse:

import direct.directbase.DirectStart
run()

However, Eclipse fails during import:

DirectStart: Starting the game.
Traceback (most recent call last):
  File "/Users/stokes/Documents/Eclipse/pandatest/src/pandatest.py", line 1, in <module>
    import direct.directbase.DirectStart
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/directbase/DirectStart.py", line 3, in <module>
  File "Panda3D-tpl-rw/Panda3D/1.6.2/lib/direct/showbase/ShowBase.py", line 10, in <module>
  File "/Applications/Panda3D/1.6.2/lib/pandac/PandaModules.py", line 1, in <module>
    from libpandaexpressModules import *
  File "/Applications/Panda3D/1.6.2/lib/pandac/libpandaexpressModules.py", line 1, in <module>
    from extension_native_helpers import *
  File "/Applications/Panda3D/1.6.2/lib/pandac/extension_native_helpers.py", line 75, in <module>
    Dtool_PreloadDLL("libpandaexpress")
  File "/Applications/Panda3D/1.6.2/lib/pandac/extension_native_helpers.py", line 73, in Dtool_PreloadDLL
    imp.load_dynamic(module, pathname)
ImportError: dlopen(/Applications/Panda3D/1.6.2/lib/libpandaexpress.dylib, 2): Library not loaded: libp3dtool.dylib
  Referenced from: /Applications/Panda3D/1.6.2/lib/libpandaexpress.dylib
  Reason: image not found

Obviously, it’s not finding some resource it needs, but the PYTHONPATH in each environment appears to be identical, so this is somewhat mysterious. I find it particularly strange that it finds some of the required Panda3D files but not all.

Have I missed some obvious step in setting this up?

Thanks,
David

In the eclipse environment settings, add /Applications/Panda3D/1.6.2/lib to DYLD_LIBRARY_PATH.

Thanks for the quick response!

I don’t know where to find Eclipse’s environment settings – the environment variables (e.g. PYTHONPATH) seem to be named explicitly – but I did add DYLD_LIBRARY_PATH to ~/.MacOSX/environment.plist and Panda3D now runs. However, the syntax highlighting in the Eclipse editor marks the import as not being used and does not recognize run(). My semi-educated guess is that the library does a lot of execution at import time which PyDev does not process.

Is there a fix for this, or should I just accept it and/or change editors?

You’ll need to import the “direct” and “lib” trees of Panda into eclipse for it to recognize them, I think.
I didn’t know there was a .MacOSX/environment.plist, maybe we should write to that instead.

I never did get this working properly, but I discovered that I’m experiencing the same problem with other libraries in Eclipse – specifically, just now when using PIL. So, apparently, the path modifications were all that needed to be done for Panda3D. The rest is probably a more general misconfiguration on my end and not a specifically Panda3D-related problem at all.

Apparently, ~/.MacOSX/environment.plist is where environmental stuff for all OS X GUI apps is supposed to go. It took some digging and a fair amount of frustration before I discovered that. I suppose it makes sense, though, as they aren’t launched from the shell and thus wouldn’t be reading shell-specific configuration files.

Thanks again!

I need instructions for using eclipse with panda under windows. Any help would be GREATLY appreciated becaue I am completely lost.

have you already installed the python plugin for eclipse.pydev.sourceforge.net/

  1. install pydev for eclipse
  2. in eclipse. menu window -> preferences -> pydev -> interpreter - python -> new -> choose your panda3d python.exe
    thats it.