Embedding Python in a plugin

Discussion in 'Python' started by Daniel Holth, Jul 14, 2003.

  1. Daniel Holth

    Daniel Holth Guest

    Hello! I am trying to embed Python into an xmms plugin using
    Debian/unstable/i386, gcc 3.3.1 and Python 2.2.3+. The plugin is a shared
    library loaded by xmms. The plugin is dynamically linked with the python
    library.

    Running scripts works but when I try to import python extensions I get these
    kinds of errors:

    Traceback (most recent call last):
    File "<string>", line 1, in ?
    File "/home/dholth/lib/python2.2/site-packages/xmmspy.py", line 12, in ?
    import time
    ImportError: /usr/lib/python2.2/lib-dynload/time.so: undefined symbol:
    PyExc_IOError

    I'm using all the compiler options I can find!

    /bin/sh ./libtool --mode=link gcc -Wall -I/usr/include/xmms
    -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -g
    -O2 -I/usr/include/python2.2 -I/usr/include/glib-1.2
    -I/usr/include/python2.2 -g -O2 -I/usr/include/python2.2 -o libxmmspy.la
    -rpath /usr/lib/xmms/General -module -avoid-version -Xlinker
    -export-dynamic xmmspy.lo -lstdc++ -lpython2.2 -L/usr/lib -L/usr/X11R6/lib
    -lgtk -lgdk -rdynamic -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm -lxmms

    .... including "-Xlinker -export-dynamic" as suggested by distutils.

    How do I embed Python in an application where the main application has no
    knowledge of Python, only the dynamically loaded plugin does? Which
    programs do this already?

    Thanks a heap,

    Daniel Holth
    http://dingoskidneys.com/
     
    Daniel Holth, Jul 14, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. PilotYid
    Replies:
    1
    Views:
    681
    Andrew Thompson
    Oct 31, 2005
  2. Marcin Cenkier
    Replies:
    1
    Views:
    5,506
    Marcin Cenkier
    Apr 12, 2006
  3. Roger Edberg

    embedding python in a plugin

    Roger Edberg, Jul 18, 2006, in forum: Python
    Replies:
    0
    Views:
    285
    Roger Edberg
    Jul 18, 2006
  4. Jimmy
    Replies:
    0
    Views:
    549
    Jimmy
    Mar 15, 2007
  5. Replies:
    1
    Views:
    773
Loading...

Share This Page