Panda3D and Eclipse under MacOS X...

Return to Installation

Panda3D and Eclipse under MacOS X...

Postby Stokes » Mon Jul 13, 2009 9:33 am

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:

Code: Select all
import direct.directbase.DirectStart
run()


However, Eclipse fails during import:
Code: Select all
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
Stokes
 
Posts: 3
Joined: Mon Jul 13, 2009 9:17 am
Location: Boston Area, MA, USA

Postby rdb » Mon Jul 13, 2009 9:47 am

In the eclipse environment settings, add /Applications/Panda3D/1.6.2/lib to DYLD_LIBRARY_PATH.
I rarely respond to PMs
rdb
 
Posts: 8631
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby Stokes » Mon Jul 13, 2009 2:55 pm

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?
Stokes
 
Posts: 3
Joined: Mon Jul 13, 2009 9:17 am
Location: Boston Area, MA, USA

Postby rdb » Tue Jul 14, 2009 1:50 am

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 rarely respond to PMs
rdb
 
Posts: 8631
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby Stokes » Sat Aug 01, 2009 5:26 pm

pro-rsoft wrote:You'll need to import the "direct" and "lib" trees of Panda into eclipse for it to recognize them, I think.


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.

pro-rsoft wrote:I didn't know there was a .MacOSX/environment.plist, maybe we should write to that instead.


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!
Stokes
 
Posts: 3
Joined: Mon Jul 13, 2009 9:17 am
Location: Boston Area, MA, USA

Postby Shaba1 » Wed Aug 05, 2009 8:03 pm

I need instructions for using eclipse with panda under windows. Any help would be GREATLY appreciated becaue I am completely lost.
Shaba1
 
Posts: 195
Joined: Sat Sep 24, 2005 1:26 pm

Postby ditus » Sun Aug 09, 2009 8:33 pm

have you already installed the python plugin for eclipse.http://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.
is the idea of the lenov diing? no!
the aries is already on build :)
User avatar
ditus
Troll
 
Posts: 277
Joined: Mon Oct 15, 2007 2:15 pm
Location: moon


Return to Installation

Who is online

Users browsing this forum: No registered users and 1 guest