Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4383140
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:52:08+00:00 2026-05-21T12:52:08+00:00

I am attempting to use pynotify for a small project, but am having a

  • 0

I am attempting to use pynotify for a small project, but am having a strange problem on my Fedora 13 machine. It appears that when pynotify is run programmatically it crashes when show() is called – however if I type that line myself it runs fine! I have tested it also on my Ubuntu box, where it runs absolutely fine.

My testing code is:

import pynotify

pynotify.init('someName')
n = pynotify.Notification("Summary", "Body")
n.show()

And the results of running this:

$ python -i test.py 
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    n.show()
glib.GError: Unable to connect to server
>>> n.show()
True
>>> 

So, does anyone have any ideas what may cause this sort of behaviour? Unfortunately the Fedora environment is one that I have little control over, so any solutions requiring root access/etc would not really work. I can try installing pynotify locally, however, if needed. Thanks for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T12:52:09+00:00Added an answer on May 21, 2026 at 12:52 pm

    Since Owen has not accepted my offer to take this answer, here is the solution that worked for me. Note that I have no idea why this works (other than vague guesses), and that I don’t make any sort of guarantees about whether this is a good solution or not, but maybe if you are ever in as odd a position as I was this will help.

    If you execute n.show() twice, it will run successfully the second time. Therefore, in order to avoid setting two notifications on a system where Pynotify does work correctly, I have used the following:

    import pynotify
    
    pynotify.init('someName')
    n = pynotify.Notification("Summary", "Body")
    try:
        n.show()
    except:
        n.show()
    

    Note of course that this small example has flaws, least of all the outcome if there is an actual problem with Pynotify that will be thrown on both n.show()s – this is merely a minimum working example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to use asp.net mvc's Action Result of File. So it would seem that
Im attempting to use fxCop on a C# Project as kind of basis for
While attempting to use the CopyFile() function I have encountered a strange error. It
In attempting to use the Performance Tools on an ASP.NET website I'm getting various
I'm attempting to use Mono to load a bitmap and print it on Linux
I'm attempting to use TinyXML to read and save from memory, instead of only
I am attempting to use the 'tempfile' module for manipulating and creating text files.
We are attempting to use a SQL Server 2003 database for our test records
I'm attempting to use extension methods to add an operater overload to the C#
I am attempting to use Ant's XMLValidate task to validate an XML document against

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.