Describe the bug
pync.notify doesn't work in python scripts used by launchd, but works when the python script is directly executed.
So I have python script in /Users/tscp/testdir/test-pync/test_pync.py:
#!/usr/local/bin/python3.8
import pync
import sys
print('before')
pync_imported = 'pync' in sys.modules
print(f'pync is imported: {pync_imported}')
pync.notify('test pync')
print('after')
It works as expected (a notification is shown) when run with ./test_pync.py, but doesn't run in my launchd job /Users/tscp/Library/LaunchAgents/test_pync.plist:
If you install terminal-notifer via homebrew and call directly with os.system for example it works; however the $PATH variable must be set inside the launchd plist file.
Describe the bug pync.notify doesn't work in python scripts used by launchd, but works when the python script is directly executed.
So I have python script in
/Users/tscp/testdir/test-pync/test_pync.py
:It works as expected (a notification is shown) when run with
./test_pync.py
, but doesn't run in my launchd job/Users/tscp/Library/LaunchAgents/test_pync.plist
:This is the content of
/tmp/local.job.stdout
after the job is loaded:The script seemed to run successfully but the notification was not shown.
To Reproduce Steps to reproduce the behavior:
Expected behavior A notification like this is shown when the job is loaded and run:
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context Add any other context about the problem here.