我是 Mac 新手,我正在尝试使用 VSCode 上的代码运行器扩展在我的 iMessage 上运行一些有趣的统计数据。我一直在关注这篇文章:https://towardsdatascience.com/heres-how-you-can-access-your-entire-imessage-history-on-your-mac-f8878276c6e9
但是,当我运行该行时,conn = sqlite3.connect('/Users/<username>/Library/Messages/chat.db')
我收到错误sqlite3.OperationalError: unable to open database file
据我所知,我的问题是 VScode 没有正确的权限来访问 ~/Library/Messages 文件夹,也可能没有访问 chat.db 的权限。首先,我ls -l在 Library 上运行,结果是drwx---rwxMessages。因此,我尝试同时使用chmod a+rwx Messages和来打开所有内容的权限,但两次都sudo chmod a+rwx Messages出现错误。chmod: Unable to change file mode on Messages: Operation not permitted我做错了什么和/或者有更好的方法吗?或者只是无法更改该文件夹的权限?