14

I know it might be bad idea to rename project root directory, but while doing it I got following error:

enter image description here

I did it as follows:

enter image description here

enter image description here

Cant I really rename project root directory? How this option works? Is their any way to close the project (and all its files) in PyCharms and then rename?

MsA
  • 2,599
  • 3
  • 22
  • 47

4 Answers4

35

I had the same exception occurring. The java exception indeed indicates that something is using the folder (or contents within the folder). Stupidly, for me this was the python console within PyCharm. Within PyCharm, click on your python console and type exit() and hit enter. Then repeat your previous steps of refactor --> rename and you should be able to rename the directory. Note that the old folder will still be present at the directory it existed with only the .idea folder and files present.

EDIT: This was working last week, but now it randomly fails. Which would seem like something else is keeping the folder or contents occupied. For now it seems that waiting 5 to 10 minutes not doing anything allows renaming. Perhaps PyCharm keeps working on the folder in the background and you wait until it is done with whatever it is doing?

ddkvn
  • 3
  • 1
ddkvn
  • 351
  • 3
  • 3
2

I had the same issue, but when I closed all processes in that folder / its nested folders, the rename operation was completed successfully.

el_nektarin
  • 343
  • 1
  • 14
0

Same problem here, it seems like some process or something is using the folder. Closed the PyCharm terminal and stopped my Running configuration solved the problem.

0

Opening "Task Manager" and terminating Python activity worked for me