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

Macox notification - AttributeError: 'NoneType' object has no attribute 'setDelegate_' #586

Closed
wwj718 opened this issue Sep 28, 2020 · 3 comments

Comments

@wwj718
Copy link

wwj718 commented Sep 28, 2020

Python == 3.7.2
MacOS 10.13.5
Plyer == 1.4.3
PyInstaller == 3.6

After I packed file with PyInstaller I got following error when I run notify.

Traceback (most recent call last):

 File "plyer/facades/notification.py", line 84, in notify
  File "plyer/platforms/macosx/notification.py", line 46, in _notify
AttributeError: 'NoneType' object has no attribute 'setDelegate_'

and I had added "plyer.platforms.macosx.notification" to hiddenimports

@wwj718 wwj718 closed this as completed Sep 28, 2020
@0xSEM
Copy link

0xSEM commented May 2, 2023

I'm facing this same issue on

Python 3.9/3.10
MacOS Ventura 13.3.1
Plyer 2.1.0
PyInstaller 5.1.0

After packing my app with PyInstaller. Can you elaborate how you've fixed this? @wwj718

@0xSEM
Copy link

0xSEM commented May 2, 2023

#551 This actually fixed the issue for me.

The existing implementation seems to work fine, but once packed with PyInstaller the default implementation returns a NoneType for 'NSUserNotificationCenter' (which according to Apple is also deprecated https://developer.apple.com/documentation/foundation/nsusernotificationcenter)

@blazing-gig
Copy link

The issue occurs even without PyInstaller with the below spec:

Python: 3.10
MacOS Monterey: 12.7
Plyer: 2.1.0

I believe #551 fixes the problem. +1 for getting it merged in the main trunk.

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

3 participants