CreateProcess error=2, The system cannot find the file specified – Pycharm

  pycharm, python

FIRST OF ALL: I just started python like a few days ago. I have just started and know almost nothing.

I was trying to get some code to work and I looked up solutions to it and people said to uninstall python and reinstall it, so I did just so. Of course I’m facing the consequences. (The code was a color detection program with pyautogui)

So now pycharm is say Error:Cannot run program "C:UsersUser-name…python.exe" : CreateProcess error=2, The system cannot find the file specified

Of course I have no idea what this means. But I am gonna take a big guess a say this has something to do with the virtual environment and path stuff.

Dear god this is so frustrating. I have been trying different things for hours. I’ve tried reinstalling pycharm, python, and creating new interpreters. Please I just need help this, I am in desperate need. And please try to explain the steps simply since I just got pycharm two days ago. Thank you in advance. 🙁

Source: Python Questions

2 thoughts on - CreateProcess error=2, The system cannot find the file specified – Pycharm

  • I guess you might already have a solution.
    It’s about where your project folder ist located. In your error message you probably have a different location for your project. While creating your project and venv you have to double-check that you dont use an existing interpreter and that your venv is located in your project-directory. You also don’t need to check “Make available to all projects” except you want to make another project or version with the same modules etc.

  • I had this error too and found my “configurations” to be off so that my python interpreter was invalid.
    You can change it for a single file in the top right under “edit configurations” or for all files under file>settings>Project:Name>Interpreter

    I also had to remove the old interpreter with the old name (I got this error because I changed the name of my project at some point) and add a new one with existing venv location

    Hope this helps