Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If i create a quickly-project with the following command in terminal:

 quickly create ubuntu-application helloworld

and then add in the the following lines,

import sys
import pynotify

the line "import pynotify" produces the following error-output on my system when i want to run the application with

quickly run


/usr/lib/python2.7/dist-packages/gobject/ Warning: g_boxed_type_register_static: assertion g_type_from_name (name) == 0' failed import gobject._gobject /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/ Warning: specified class size for typePyGtkGenericCellRenderer' is smaller than the parent type's GtkCellRenderer' class size from gtk import _gtk /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/ Warning: g_type_get_qdata: assertionnode != NULL' failed from gtk import _gtk

The application won't start.

But if I want to run the following python-application

 import sys
 import pynotify

 if __name__ == "__main__":
if not pynotify.init("icon-summary-body"):

n = pynotify.Notification(
    "Hello notify! It works!",

e.g. by saving the code in a filename "", I am able to run the code with the command in terminal:


and the notification works fine!

What is the problem with the via quickly created python applicaton?? Why is the import not working?? I am new with quickly and python.

share|improve this question
up vote 7 down vote accepted

I just ran into exactly the same problem.

Here's my solution.

from gi.repository import Notify

Notify.init ('Application')
notification = ('Title', 'Message', 'dialog-information') ()
share|improve this answer
Thanks! This works fine for me! (Do you additionally know how to show an individually icon from the quickly "media"-folder instead of the standard "dialog-information"-Icon?) – Marian Lux Jun 26 '12 at 13:18
I'd imagine you could just point it to the file. – RobinJ Jun 26 '12 at 13:24
os.getcwd() + '/data/media/picture.png' works for me! I hope it works also after packaging. I don't understand why './data/media/picture.png' is not working. – Marian Lux Jun 26 '12 at 13:37
Because the file is in the bin directory, probably. – RobinJ Jun 26 '12 at 13:39

pynotify was written to work with pygtk, an older way of using GTK through Python. The new method is called gobject introspection, and has imports like:

from gi.repository import Gtk

You can't use the old and the new system in the same application, and the quickly template uses the new system, so you can't use pynotify with it.

I have a replacement that's compatible with the new system: notify2. It's not in precise yet, but I've submitted a backport request for it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.