Permission Error When Writing to a File Using Python in DIAdem

Updated Nov 2, 2023

Reported In

Software

  • DIAdem

Issue Details

When trying to write to a file in DIAdem using Python I get the following error "PermissionError: [Errno 13] Permission denied:".

Solution

In order to overcome this issue, we have to either run DIAdem as an administrator or specify an absolute path for the file so that it is not under system files.

Additional Information

The reason behind this behavior is quite simple, when specifying only the filename when creating the file, by default Python will try to create a file in the same folder where the Python file is, which by default when creating from DIAdem will be under system files thus preventing the creation of the file.