Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending of notifications fails with "OSError: [Errno 2] No such file or directory" #11

Closed
KebabLord opened this issue Sep 6, 2018 · 5 comments

Comments

@KebabLord
Copy link

Weechat masterrace here, getting this output when someone mentions me;

python: stdout/stderr (notify_send): Traceback (most recent call last):
python: stdout/stderr (notify_send):   File "/root/.weechat/python/autoload/notify_send.py", line 233, in message_printed_callback
python: stdout/stderr (notify_send):     send_notification(notification)
python: stdout/stderr (notify_send):   File "/root/.weechat/python/autoload/notify_send.py", line 638, in_send_notification
python: stdout/stderr (notify_send):     stdout=devnull,
python: stdout/stderr (notify_send):   File "/usr/lib/python2.7/subprocess.py", line 185, in check_call
python: stdout/stderr (notify_send):     retcode = call(*popenargs, **kwargs)
python: stdout/stderr (notify_send):   File "/usr/lib/python2.7/subprocess.py", line 172, in call
python: stdout/stderr (notify_send):     return Popen(*popenargs, **kwargs).wait()
python: stdout/stderr (notify_send):   File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
python: stdout/stderr (notify_send):     errread, errwrite)
python: stdout/stderr (notify_send):   File "/usr/lib/python/subprocess.py", line 1047, in_execute_child
python: stdout/stderr (notify_send):     raise child_exception
python: stdout/stderr (notify_send): OSError: [Errno 2] No such file or directory
python: error in function "message_printed_callback"
@s3rvac s3rvac changed the title Getting error with functions Sending of notifications fails with "OSError: [Errno 2] No such file or directory" Sep 6, 2018
@s3rvac
Copy link
Owner

s3rvac commented Sep 6, 2018

Hi. Do you have libnotify installed in your system? You can verify this by running the following command from a terminal:

notify-send --help

If it fails with

notify-send: command not found

then you will need to install it (see README). Let me know if this fixes the issue for you.

@KebabLord
Copy link
Author

Yeah, I haven't installed libnotify, but seems like the website's download section is broken.
At least I found it on my distro's apt library but I don't know which one to install, can you inform me about which is needed?

libdesktop-notify-perl - Perl module which communicates with the Desktop Notifications framework
libnotify-bin - sends desktop notifications to a notification daemon (Utilities)
libnotify-cil-dev - CLI library for desktop notifications
libnotify-dev - sends desktop notifications to a notification daemon (Development files)
libnotify-doc - sends desktop notifications to a notification daemon (Documentation)
libnotify0.4-cil - CLI library for desktop notifications
libnotify3.0-cil - CLI library for desktop notifications
libnotify3.0-cil-dev - CLI library for desktop notifications
libnotify4 - sends desktop notifications to a notification daemon
profanity - console based XMPP client
python-notify - Python bindings for libnotify
rerun - tool to launch commands and restart them on filesystem changes
ruby-notiffany - Wrapper libray for most popular notification libraries
undistract-me - Notifies user when long-running terminal commands complete via libnotify
vlc-plugin-notify - LibNotify plugin for VLC
libgtk2-notify-perl - Perl interface to libnotify
mango-lassi - Share mouse and pointer with other computers
pidgin-libnotify - display notification bubbles in pidgin

@s3rvac
Copy link
Owner

s3rvac commented Sep 11, 2018

You need to install libnotify-bin, which provides /usr/bin/notify-send. Let me know if this fixes the issue for you.

s3rvac added a commit that referenced this issue Sep 30, 2018
From a user's viewpoint, this is better than showing the complete backtrace
(see #11).
@s3rvac
Copy link
Owner

s3rvac commented Sep 30, 2018

I am closing the issue due to inactivity. If the installation of libnotify-bin has not fixed the problem for you, please reopen the issue.

@s3rvac s3rvac closed this as completed Sep 30, 2018
@s3rvac
Copy link
Owner

s3rvac commented Sep 30, 2018

BTW, in 16aeda1, I have added printing of a more reasonable error message when sending of a notification fails:

Failed to send the notification via notify-send (reason: 'OSError: [Errno 2] No such file or directory').
Ensure that you have notify-send installed in your system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants