symbol not found involving dynlink/dlopen/embedding Python

Christopher Armstrong radeex at
Sun Dec 19 10:55:20 CET 2004

With the following situation, Numarray can't find Python's symbols.

  Main dlopens Two
  Two dynlinks Python
  Python dlopens Numarray
  Numarray dynlinks Python

I have another pure-C example that tries to mirror this, with::

  Main dlopen Two
  Two dynlink Middle
  Middle dlopen Three
  Three dynlink Middle

and it works fine.

AFAICT, I'm using the same dlopen flags that Python is.

The minimal reproduction code is very small, but broken into several
files (to emulate the different parts). It's browsable at , and
downloadable at

After doing some googling, I've found several people that look like
they have similar problems. I even found one workaround involving
LD_PRELOAD. if you ./main, then the symbols
are found.

Does anyone have any idea on how I can solve this? I'd like to not
hack CPython, and not have tie the build to a single machine.

  Twisted   |  Christopher Armstrong: International Man of Twistery
   Radix    |    --
            |  Release Manager, Twisted Project
  \\\V///   |    --
   |o O|    |  Founding Member, Hobart Hacking Society
w----v----w-+    --

More information about the Python-list mailing list