Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Embedded python issue with gtk

Thread Tools

Embedded python issue with gtk

Oliver Marks
Posts: n/a
I have already emailed about this issue, but have still not got any

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

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

#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")


/* 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){

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/", line 30,
in <module>
import gobject as _gobject
File "/usr/lib/pymodules/python2.6/gtk-2.0/gobject/", 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/", line 22,
in <module>
from glib._glib import *
ImportError: /usr/lib/ undefined symbol:

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ruby GTK Fortune Cookies (gtk-fortune-0.1.1) Alex Shulgin Ruby 1 11-21-2007 01:05 AM
GTK+, segmentation fault in gtK-editable_get_chars C Programming 2 05-29-2007 03:27 PM
python QT or python-GTK Jon Van DeVries Python 6 03-21-2007 07:28 PM
ruby/GTK : Embedded terminal or redirecting process output Mickael Faivre-Macon Ruby 2 10-10-2006 02:13 AM
compiling ruby under windows (+ gtk stuff, is the gtk list dead?) Gergely Kontra Ruby 2 06-18-2004 10:20 PM