PyCharm tells me "Cannot start process, the working directory ... does not exist"

After testing for a bit, I've found a solution (but not an answer to why this error occurs in PyCharm):

Delete the file and create it again. (Or rename or move it and create a new file with its old name, both should work.)


It happens because when you create a file it automatically assigns the working directory to it's configuration, which of course is the one where you created it.

You can change that by going into Run -> Edit Configurations. Click on the folder icon in Script path: and correct the path to the file. Click OK to save and you should be able to Run the file again.


Set the working directory correctly

1. File-> Settings

2. Build, Execution, Deployment -> Console -> Python Console

3. Working directory: [The path to the directory where the file you're currently working on resides.]


I had the same problem, mine is probably related to the explaination gave by the others, it comes from the dir .idea, files *.xml contain the variable $DIR_PROJECT$.

Therefore, as the attribution of a new path didn't work, I just deleted my .idea, that is automatically loaded each time I open my project's directory.

It automatically regenerated the .idea, asked for the script path... And it worked perfectly

CAREFUL => You will automatically lose your project settings, you are deleting the "settings file"