Skip to content
Sign upLog in
← Back to Community

Notify2 module

Profile icon
KanishkKrishna

Hi,
I am trying to import the notify2 module and I see this error:


Traceback (most recent call last):
File "main.py", line 1, in
import notify2
File "/home/runner/.local/share/virtualenvs/python3/lib/python3.8/site-packages/notify2.py", line 39, in
import dbus
ModuleNotFoundError: No module named 'dbus'

What should I do?

Thanks

Voters
Profile icon
Kamakuraaaa
Profile icon
AYDENMCCONNELL
Profile icon
KanishkKrishna
Comments
hotnewtop
Profile icon
elonmaks

And if you using Windows OS you will not find dbus there. There is no dbus for Windows nowaday. Only Linux/Unix versions exist. And it only has the nearest analogue for Windows port. It is COM port or another IPC mechanisms such as:

The following IPC mechanisms are supported by Windows:

Clipboard
Data Copy
DDE
File Mapping
Mailslots
Pipes
RPC
Windows Sockets

If you want to use D-BUS protocol you should install it on the Python for Linux version. Because D-BUS is Linux's component.

Profile icon
elonmaks

Hi,

@KanishkKrishna
. You should install dbus-python with notify2 module.
pip install notify2
pip install dbus-python

And it will work for you.

Profile icon
KanishkKrishna

I am trying this in repl. There is no need to install something right? Thanks

@elonmaks

Profile icon
elonmaks

@KanishkKrishna
. Yes it seems like repl.it bugs. Repl it also cannot download the packages from the left side bar.

When you download notify2 it's good.
But when you trying to download dbus-python it's failed because we are using pip_19.2.3 module. I checked my version of pip and it is pip_20.0.2. So I a little bit surprised why it cannot download it. I've asked a question from the tech support of repl.it and sent them screenshots of my console.

If you want you can ask for help too. From tech support on this link below:

https://repl.it/bugs/