I have a script that processes my screen time data using the SQLite database /Users/USERNAME/Library/Application Support/Knowledge/knowledgeC.db. The script runs fine when I launch it manually via Terminal, but I want to run it on a schedule via launchd. When it runs in launchd I get this error:

Traceback (most recent call last):
  File "script.py", line 31, in <module>
    conn = sqlite3.connect(db)
sqlite3.DatabaseError: authorization denied

How do I resolve this error?

1 Answer 1


That file is protected from automated access by Transparency, Consent, and Control. To remove that protection you have to grant Full Disk Access to the Python interpreter in the Security and Privacy settings. You must already have done that for the Terminal app.

  • For those who find this answer, I didn't have much success adding the python interpreter to Full Disk Access, or zsh, or launchd and launchctl. Eventually I used fdautil from this product soma-zone.com/LaunchControl and it worked.
    – ahalbert
    Jul 12, 2023 at 14:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .