getConfigShowbase not found

While we are working out the problems with the windows build, I am attempting to build cvs on linux as well (ubuntu). I finally got it built, but while pview works, anything that tries to import direct.directbase.DirectStart fails in the python code saying that getConfigShowbase is not found:

$ python Tut-Roaming-Ralph.py
DirectStart: Starting the game.
Traceback (most recent call last):
  File "Tut-Roaming-Ralph.py", line 11, in <module>
    import direct.directbase.DirectStart
  File "/usr/share/panda3d/direct/directbase/DirectStart.py", line 3, in <module>
    from direct.showbase import ShowBase
  File "/usr/share/panda3d/direct/showbase/ShowBase.py", line 14, in <module>
    __builtin__.config = getConfigShowbase()
NameError: name 'getConfigShowbase' is not defined

any suggestions?

getConfigShowbase() is indeed a new function in the cvs version of libpanda.so, but it is not present in the 1.6.2 version of libpanda.so.

I therefore suspect you are inadvertently loading the 1.6.2 version of libpanda.so, instead of the one you have just built. Try completely uninstalling all old versions of Panda just to remove any doubt.

David

no good…it was never on the machine before, but I unistalled it and reinstalled it anyways for the same behavior…

Looking a little closer, getConfigShowbase() is actually defined in libshowbase.so. It appears at line 42 of direct/src/showbase/showBase.h:

EXPCL_DIRECT DConfig &get_config_showbase();

and you can see it in your libshowbase.so file with the nm command:

[drose@orpheus lib]$ nm libshowbase.so | grep get_config_showbase
00006660 d Dtool_get_config_showbase_3_comment
00002820 T _Z19get_config_showbasev
00004250 t _Z27Dtool_get_config_showbase_3P7_objectS0_S0_
00006c14 b _ZZ19get_config_showbasevE15config_showbase
00006c8c b _ZZ27Dtool_get_config_showbase_3P7_objectS0_S0_E13key_word_list

And you can see it in Python when you import libp3direct.so (which in turn links with libshowbase.so):

>>> import libp3direct
>>> libp3direct.getConfigShowbase
<built-in function getConfigShowbase>

And finally, genPyCode puts this (along with every other C++ symbol) into PandaModules:

>>> from pandac.PandaModules import getConfigShowbase
>>> 

So, in your case, one of these steps must have failed.

David

For the record, if you’ve built with makepanda, there is no libshowbase.so and the symbols are in libp3direct.so instead.

Darn it, one of these days I’m going to learn the full set of things that are different about a makepanda build. :confused:

David

okay, so I found the indicated function in libp3direct:

00093960 T _Z19get_config_showbasev
00094930 t _ZL27Dtool_get_config_showbase_3P7_objectS0_S0_
0015b5e4 d _ZL35Dtool_get_config_showbase_3_comment
00164654 b _ZZ19get_config_showbasevE15config_showbase
001646b0 b _ZZL27Dtool_get_config_showbase_3P7_objectS0_S0_E13key_word_list

however, whenever I try to import libp3direct, I get this error:

>>> import libp3direct
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/panda3d/libpanda.so: undefined symbol: avcodec_decode_audio3
>>> import libp3direct
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/panda3d/libpanda.so: undefined symbol: avcodec_decode_audio3

although I had no linking errors in the makepanda build system…

and the last one gives the same errorabout getConfigShowBase:

>>> from pandac.PandaModules import getConfigShowbase
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name getConfigShowbase
>>> 

It looks like I might not have all the requisite libraries if the original thing is giving an error about audio??? but then how come there is no error when using the python import?

Ah, this looks like a problem with ffmpeg. You could try removing ffmpeg from your build using the makepanda command line.

As to why you didn’t see this error message when importing PandaModules, well, I have recently added a try…except to PandaModules, in an attempt to quietly ignore modules that aren’t built or installed, which is particularly necessary when running code in the plugin system, where all modules might not have been downloaded. Unfortunately, this has the side-effect of squelching useful error messages like this. :frowning: Maybe I can find a better solution.

David

compile with --no-ffmpeg worked, and it is working now…thank you!

Alternatively, instead of compiling without ffmpeg, remove ffmpeg from your thirdparty tree to force makepanda to use the system version - if present.

Anyhow, compiling with --no-ffmpeg did not solve this problem for me.

What’s your next suggestion?

Dirk

@drwr: I’ve just checked in a fix to DoGenPyCode - it will now only ignore the ImportError if it failed to find the library. If it’s there, but a load error has occurred, it still raises the exception.

@dirkmitt: Can you try this to find out which symbol is missing:

cd /usr/lib/panda3d/
python -c "import libpanda"

(Replace /usr/lib/panda3d/ with the directory where your panda3d libraries are, of course.)

@rdb: I did what you suggested, and copied and pasted the “Konsole” output here:

dirk@Thunderbox:/usr/lib/panda3d$ ls
libp3direct.so libp3glstuff.so libp3pystub.so libpandagl.so libpandaskel.so
libp3dtoolconfig.so libp3heapq.so libpandaegg.so libpandamesa.so libpanda.so
libp3dtool.so libp3openal_audio.so libpandaexpress.so libpandaode.so libtinydisplay.so
libp3framework.so libp3ptloader.so libpandafx.so libpandaphysics.so
dirk@Thunderbox:/usr/lib/panda3d$ python -c “import libpanda”
Traceback (most recent call last):
File “”, line 1, in ?
ImportError: libpandaexpress.so: cannot open shared object file: No such file or directory
dirk@Thunderbox:/usr/lib/panda3d$

What I find bizarre, is that python complains about not being able to find libpandaexpress.so , even though it was just listed right there in front of me. :confused:

Dirk

Huh, that is weird. Can you try doing this, before trying to import libpanda:

export LD_LIBRARY_PATH=/usr/lib/panda3d
sudo ldconfig

Also, try importing libpandaexpress (rather than libpanda) in case anything is wrong with that.

Actually, the fact is that I was not alert enough this ‘morning’, to act on the information myself, before relaying it to you. :slight_smile:

The output which I just posted proves, that my /etc/ld.so.conf.d directory must not have been doing its job correctly. And this is how I solved my problem:

root@Thunderbox:/etc/ld.so.conf.d# ls -l
total 12
-rwxr-xr-x 1 root root 64 2006-08-02 08:24 i486-linux-gnu.conf
-rwxr-xr-x 1 root root 25 2008-11-30 21:55 ogrenew.conf
-rw-r--r-- 1 root root 17 2009-11-08 01:00 panda3d.conf
root@Thunderbox:/etc/ld.so.conf.d# chmod a+x panda3d.conf
root@Thunderbox:/etc/ld.so.conf.d# ls -l
total 12
-rwxr-xr-x 1 root root 64 2006-08-02 08:24 i486-linux-gnu.conf
-rwxr-xr-x 1 root root 25 2008-11-30 21:55 ogrenew.conf
-rwxr-xr-x 1 root root 17 2009-11-08 01:00 panda3d.conf
root@Thunderbox:/etc/ld.so.conf.d#

The file panda3d.conf, which your installer left there, did not have execute permissions set. And once I did set those execute permissions by hand, I can now do the tutorial, and I get the gray window. I also get momentary noise from my speakers which I’m used to on this box, which tells me that sound output has been opened.

Therefore, Panda3D could not well have loaded any modules the way it was before, until this problem was fixed.

Thank you for the support, rdb!

Dirk

P.S. Yes, it’s another piece of weirdness on my computer, that I’m using the SPDIF sound output, yet that I have it connected to an ancient amplifier. The latter causes a brief ‘coughing sound’ whenever a stream is being opened. Rather than try to fix it (probably by buying a better amp), I use this as a hint to my brain, that sound output has been opened, even if silence is being played. And the Panda3D tutorial now runs without any error messages at all in the “Konsole” console window, with the gray window displaying successfully, and with a ‘silent’ sound stream being opened.

This gives me the additional reassurance, that my ffmpeg libraries should also be fine…

P.S.S. Now that I have also rebuilt ODE, the question was bothering me, of whether I’d also need to rebuild OGRE, since I like to have more than one option of software to use. OGRE has nothing to do with Panda3D, except for possibly being a competitor, yet of not being a game engine by itself.

But now that I got back home, I inspected my software and relearned, that in compiling OGRE, I used a special version of ODE called ~OGREODE~ . I doubt that this is a wrapper for the other ODE, which is installed globally. And this makes my earlier claim a memory error, according to which building OGRE depended on a specific ODE version to be installed globally.

AND, since OGRE demos still run well, it would be a huge mistake to rebuild that.

Ah, I had no idea that file was supposed to have execute permissions. I’ve just checked in a fix to makepanda that should fix it for the next time.
Weird that it did work fine for me, btw. Maybe the problem only occurs on older debian versions.

I have the same problem on my netbook (eeepc with quite old xandros linux).

The symptom reported by the OP could indicate any number of wildly different problems (as suggested by the two different problems reported by two different people in this thread). We’ll need more information to help diagnose your particular situation.

Did you follow the advice already given in this thread? Do you have the library files in question, and are they executable? Can you run pview? Can you load python and “import libpandaexpress”?

David

os: xandros based on debian 4.1.1, gcc version 4.1.2, python 2.4

I have everything in ‘/usr/local/src/panda3d’ it’s symlink to external usb drive, panda is not installed by normal way

environment:
/etc/ld.so.conf.d/panda3d.conf contains /usr/local/src/panda3d/built/lib

~/.bashrc contains PYTHONPATH to /usr/local/src/panda3d/built/

/etc/Configauto.prc, Config.prc are symlinks to /usr/local/src/panda3d/built/etc

building:
makepanda/makepanda.py --everything --no-ode --no-ffmpeg

(I don’t need ODE and actually original xandros package is too old I think)

Also I have no below libraries but I hope it’s not a problem ?

WARNING: Could not locate thirdparty package artoolkit, excluding from build
WARNING: Could not locate thirdparty package fcollada, excluding from build
WARNING: Could not locate thirdparty package swscale, excluding from build
WARNING: Could not locate thirdparty package fftw, excluding from build
WARNING: Could not locate thirdparty package fmodex, excluding from build
WARNING: Could not locate thirdparty package opencv, excluding from build
WARNING: Could not locate thirdparty package squish, excluding from build
WARNING: Could not locate thirdparty package vrpn, excluding from build
WARNING: Could not locate thirdparty package tinyxml, excluding from build

Report:

  1. built/lib/*.so’s are executable
  2. pview works ok
  3. import libpandaexpress doesn’t work
  4. built/lib/libp3direct.so /.so.1.7.0 are present

but trying:
python Tut-Asteroids.py

DirectStart: Starting the game.
Traceback (most recent call last):
  File "Tut-Asteroids.py", line 13, in ?
    import direct.directbase.DirectStart
  File "/usr/local/src/panda3d/built/direct/directbase/DirectStart.py", line 3, in ?
    from direct.showbase import ShowBase
  File "/usr/local/src/panda3d/built/direct/showbase/ShowBase.py", line 14, in ?
    __builtin__.config = getConfigShowbase()
NameError: name 'getConfigShowbase' is not defined

I think the problem is that you have ffmpeg but not swscale. You should either compile with --no-ffmpeg, or install libswscale correctly.