I have already installed pynotify using :
pip install py-notify
When I re-run this it shows :
Requirement already satisfied (use --upgrade to upgrade).
I also tried :
pip install --upgrade py-notify
but it shows :
Requirement already up-to-date.
Below is my simple code to show desktop notification using pynotify.
import pynotify
pynotify.init("Basic")
n = pynotify.Notification("Title", "Some sample content")
n.show()
What should I do now to run below code correctly?
If you need to send GTK balloons - you've not installed correct library.
If you want to use "Observer programming pattern" (callback management) - you are using incorrect syntax.
There are two similar packages:
http://www.pygtk.org/
) to work. Can't be installed frompip
. Usually installed with some OS package (something likepython-pynotify
). Usage:import pygtk;pygtk.require('2.0');import pynotify
.https://pypi.python.org/pypi/notify2
) - alternative wrapper for libnotify. Can be installed frompip
. Usage:import notify2
There are also two unrelated packages with similar names:
https://pypi.python.org/pypi/pyinotify
) - wrapper for libinotify that allows to monitor filesystem changes. Usage:import pyinotify
.https://pypi.python.org/pypi/py-notify
) - python-only library that implements hooks (callback) storage, calling and filtering with no connections to outside world (third-party libraries or standards). Usage:import notify
.faced same problem on Ubuntu 16.04
worked for me
There's a names conflict with
pynotify
.I had installed pynotify from PIP using:
Since that was the wrong choice, I removed it with:
And then installed the expected pynotify using: