Mac OS X: ImportError: No module named pandac.PandaModules

As far as I recall from using Eclipse, it sets the python and library paths itself – somewhere in the project settings, there should be a tab for path settings.
Also, I had to load in all of Panda3D’s libraries and the direct/ dir in the PyDev Preferences.

I’ve dealt with this problem before, so I hope this helps.

Eclipse doesn’t assume your OS profile environment variables. This can be really annoying if you had to set some special variable or library paths. What do you get? Works out of Eclipse, but no workie in Eclipse.

Here is the solution.

While you are editing the module in question. Click Run->Run…

You’ll see a window to add things before running your program. Command line params, etc. Click on the Environment tab. This is where to add those special variables. (Mac people! This is where you add DYLD_LIBRARY_PATH for dylibs)

Click run and you should be rolling. From then on, you can just click run since it makes the profile permanent.

I hope this helps.

I’m trying to set DYLD_LIBRARY_PATH manually in the run config like pmcfadin suggested but I’m running into a little problem. I need to set more than one path for it, but I’m not sure what the syntax for that would be. I have to include /usr/local/panda/lib and also /opt/lib for some other module that it’s requiring. I tried separating them with commas, semicolons, anything I could think of but it doesn’t seem to work. what string should I use there to get both of them included?

I believe UNIX path separator is a colon. Python makes it available for you in os.pathsep (if I’m not mistaken).

Yup, you were right. I still get an error for this library it can’t seem to find though. I never have the problem when I run it outside eclipse…

ImportError: dlopen(/usr/local/panda/lib/libpandaexpress.so, 2): Library not loaded: opt/lib/libssl.0.9.8.dylib
  Referenced from: /usr/local/panda/lib/libpandaexpress.so
  Reason: image not found

Another gotcha on Eclipse is symbolic links. If any of your libraries exist as a result of doing a ln -s with another file, Eclipse won’t follow the link.

The solution to that is just add the directory with the actual files.

I think I inadvertently fixed that when I copied over my /opt/local/lib to /opt/lib just to make sure everything was where it thought it would be.

I’m STILL having problems though! :frowning: This time, I get the following error:

ImportError: dlopen(/usr/local/panda/lib/libpanda.so, 2): Symbol not found: __cg_TIFFSetErrorHandler
  Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /opt/lib/libTIFF.dylib

I don’t think this is a symlink error this time, the library’s there in the directory. I’m going nuts trying to figure this out!!

Sounds like you’re pulling in a conflicting, and wrong, version of libTIFF.dylib. You must have multiple versions of this file on your system, and the eclipse path puts the wrong one first.

David

Dang, ok. Hope this isn’t getting too off topic, but what would be the best way to clear libtiff off my system for a fresh install?

I wouldn’t go around deleting libTIFF libraries. That might break your other software.

Just make sure you have the same value for DYLD_LIBRARY_PATH in Eclipse that you have in the shell. Whatever value you have in the shell must be right, because it works there, right? So make sure you have exactly that same value when you run Eclipse.

In the shell, type:
echo $DYLD_LIBRARY_PATH

Whatever that output is, put that in your Eclipse config.

David