Home > database >  why does pync .notify for mac not work? (python)
why does pync .notify for mac not work? (python)

Time:05-18

I'm trying to do notifications in python on mac. I have installed pync, and used the following code:

from plyer import notification
import pync, time

while True:
    pync.notify("lets do something random!")
    print("Activated!")
    time.sleep(1)

The visual studio code debugger shows this:

Activated!
Activated!
Activated!

However, no notification shows up. I have enabled notifications, with banner and sounds. Why does the notification not display? Thanks in advance!

CodePudding user response:

Yes, it works for me on MacOS 12.3.1

Make sure you have notification from terminal-notifier allowed:

System Preferences -> Notifications & Focus -> terminal-notifier and allow the notifications

Also, it might be the case that you have notifications disabled on your mac e.g. you're in "focus" mode

screenshot of settings

  • Related