Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm - cannot save files

Tags:

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

like image 575
mfn Avatar asked Mar 12 '18 21:03

mfn


People also ask

How do I save a file in PyCharm?

You can always save your changes manually: Press Ctrl+S or select File | Save All from the main menu.

Where do PyCharm files save?

By default, PyCharm stores user-specific files for each IDE instance (configuration, caches, plugins, logs, and so on) in the user's home directory. However, you can change the location for storing those files, if necessary.

How do I turn off autosave in PyCharm?

1. In Settings -> IDE Settings -> General, uncheck "Synchronize files on frame activation" uncheck "Save files on frame deactivation"

How do I add files to PyCharm?

Create new files Do one of the following: In the Project tool window Alt+1 , select the directory or package in which you want to create a new file, and then choose File | New from the main menu. Right-click the corresponding directory or package and select New from the context menu. Press Alt+Insert .


2 Answers

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.
like image 175
Dexter Avatar answered Sep 20 '22 12:09

Dexter


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.

like image 39
ivanleoncz Avatar answered Sep 23 '22 12:09

ivanleoncz