This problem occurred on the mac. The script that had no problem before, after updating the ma system, reported an error, prompting PermissionError: [Errno 1] Operation not permitted:’/Users/macbookpro/Desktop/pycharm/new_json_test.xls’
After looking for it for a long time, I passed, adding permissions to the file can’t be solved.
Later, it was discovered that the new mac system, after the update, no matter what the operation is to give permission again, we execute it through pycharm, and pycharm does not have the permission to operate the file, it prompts the above error
Two solutions: 1. Find full disk access permissions in System Preferences-Security and Privacy-Privacy, and add pycharm to it
2. Before the code is executed, use the os command to give the corresponding read file rights