Skip to content

Guake Terminal throws pynotify attribute error

An answer to this question on Stack Overflow.

Question

I regularly use Guake terminal on Ubuntu. Recently, it stopped working. When I try to run it using terminal following error occurs:

Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
 File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/dist-packages/guake/main.py", line 43, in <module>
from guake.guake_app import Guake
 File "/usr/lib/python2.7/dist-packages/guake/guake_app.py", line 49, in <module>
import guake.notifier
File "/usr/lib/python2.7/dist-packages/guake/notifier.py", line 31, in <module>
pynotify.init("Guake")
AttributeError: 'module' object has no attribute 'init'

The source code of the concerend file can be found here on GitHub repo. I have pynotify installed on the system. There seems to be a problem with pynotify.

Answer

There's a names conflict with pynotify.

I had installed pynotify from PIP using:

sudo pip install pynotify

Since that was the wrong choice, I removed it with:

sudo pip uninstall pynotify

And then installed the expected pynotify using:

sudo apt install python-notify