Embedded python issue with gtk

Discussion in 'Python' started by Oliver Marks, Nov 10, 2010.

  1. Oliver Marks

    Oliver Marks Guest

    I have already emailed about this issue, but have still not got any
    where.

    I have reduced the plugin down to its bare minimum it simple loads the
    the python interpreter and imports gtk library.

    If i do this outside the embedded python it imports and i can use the
    gtk library, so why does it not work when embedded i am on ubuntu 10.10
    64bit if its a specific issue on this platform.

    the code is below or you can get the code with the build system from the
    link below, obviously to see the error you need to load the plugin into
    geany.

    I am guessing this is a linking issue just hoping someone can point me
    in the right direction.

    http://ubuntuone.com/p/OhA/


    #include <Python.h> /* For Python itself. This MUST come first.
    */
    #include "geany.h" /* for the GeanyApp data type */
    #include "geanyplugin.h" /* for the GeanyApp data type */
    #include "plugindata.h" /* this defines the plugin API */

    #define PLUGIN_NAME _("Geany Python Test")

    PLUGIN_VERSION_CHECK(GEANY_API_VERSION)

    /* All plugins must set name, description, version and author. */
    PLUGIN_SET_INFO(PLUGIN_NAME, _("Test Python plugin."), _(VERSION),
    _("Test Author"))


    /* initialise the plugin */
    void plugin_init(GeanyData *data){
    printf("Loading the test Python module.\n");
    Py_Initialize(); /* Start the Python interpreter. */
    PyRun_SimpleString("import gtk");
    }

    /* Cleanup the plugin when required */
    void plugin_cleanup(void){
    Py_Finalize();
    }


    This is the error i get on loading of the plugin.

    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py", line 30,
    in <module>
    import gobject as _gobject
    File "/usr/lib/pymodules/python2.6/gtk-2.0/gobject/__init__.py", line
    26, in <module>
    from glib import spawn_async, idle_add, timeout_add,
    timeout_add_seconds, \
    File "/usr/lib/pymodules/python2.6/gtk-2.0/glib/__init__.py", line 22,
    in <module>
    from glib._glib import *
    ImportError: /usr/lib/libpyglib-2.0-python2.6.so.0: undefined symbol:
    PyExc_ImportError
     
    Oliver Marks, Nov 10, 2010
    #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. Colin Paul Gloster
    Replies:
    48
    Views:
    1,892
    Colin Paul Gloster
    Apr 10, 2007
  2. Replies:
    2
    Views:
    524
  3. Gergely Kontra
    Replies:
    2
    Views:
    251
    Joao Pedrosa
    Jun 18, 2004
  4. Mickael Faivre-Macon
    Replies:
    2
    Views:
    189
    Kouhei Sutou
    Oct 10, 2006
  5. Alex Shulgin
    Replies:
    1
    Views:
    180
    thefed
    Nov 21, 2007
Loading...

Share This Page