How to fix Pycharm "Cannot Save Files" issue?
Asked Answered
B

4

10

I am unable to save my files using Pycharm and I'm not sure how to fix this problem.

I have tried doing a fresh install of Pycharm using JetBrains Toolbox to make sure that it is set up correctly with default settings, but still no luck.

Here is the full log below:

https://pastebin.com/W2jTPHFz

I think my error source is in this section of my log:

Caused by: com.intellij.openapi.util.io.FileUtilRt$NIOReflect$1$2: Failed to delete D:\Scripts\.idea\workspace.xml

2018-03-13 09:31:18,076 [ 336977]   WARN - j.util.io.SafeFileOutputStream - D:\Scripts\.idea\workspace.xml (Access is denied)

java.io.FileNotFoundException: D:\Scripts\.idea\workspace.xml (Access is denied)

And this is the error message that pops up when I try to CTL+S save files: enter image description here

Basketry answered 12/3, 2018 at 21:3 Comment(0)
A
6

There are following two options to get around this error.

  1. Disable the 'safe writing' settings (Settings>Appearance and Behavior>System Settings)
  2. If step 1 did not work, restart PyCharm with an administrative privilege.
Argil answered 16/7, 2020 at 12:5 Comment(1)
This is not exactly a solution, this is you stop using the feature because it doesn't workDoyon
L
5

Generally, this is due to folder/file permissions.

You can define your_user as the owner of the folder and its adjacent files and folders:

$ chown your_user folder -R *

That might not be enough, for you can be owner of a whole directory tree, but without read/write permissions. If that's the case, you have to provide such permissions for the owner of the folder, and very likely, to all adjacent folders and files that are inside of it:

$ chmod u+rw folder -R *

On both commands, recursion (-R) is the key option, so you can extend the effect of the command (permissions assignment) throughout the entire directory tree.

Lactalbumin answered 14/4, 2021 at 3:57 Comment(0)
D
2

It can be folder permission issue. Go to the Pycharm folder-->Properties -->Security-->Edit -->Add-->Advanced-->Find Now--> select 'Everyone'-->OK--> on the 'Permission for Pycharm folder' tab, check the 'Full Control' and also 'Modify'. Now try to restart the IDE.

Dementia answered 25/1, 2022 at 7:29 Comment(0)
P
0

It can be folder permission issue. Go to the Pycharm folder-->Properties -->Security-->Edit -->Add-->Advanced-->Find Now--> select 'Everyone'-->OK--> on the 'Permission for Pycharm folder' tab, check the 'Full Control' and also 'Modify'. Now try to restart the IDE.

This worked like a charm (pun not intended lol). Cheers!

Poler answered 6/7, 2023 at 18:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.