Why can't I run a script in PyCharm, when I can debug it? I get CreateProcess error=123

I have a just reinstalled PyCharm but it is still causing me trouble: it will allow me to debug a python script, but it throws an error when I try to run it. The error when running is:

Error running test: Cannot run program "C:\Python27\python.exe" (in directory "C:\Users\Shellver\PycharmProjects\TestProject"): CreateProcess error=123, The filename, directory name, or volume label syntax is incorrect

I have tried creating new interpreters in other directories, I have turned off UAC, and have tried running PyCharm as administrator. Any other suggestions?

Thanks very much.


PyCharm 2.7.1.
Windows 7 64bit
Python 2.7

success when debugging.png

error when running.png

interpreter settings.png
Could you please attach a screenshot of your run configuration settings?
Thanks Dmitry. Here they are.


Please try going to Settings | Python Interpreters, deleting and recreating your Python interpreter. This should solve the problem.
Sorry Dmitry, I tried but it's exactly the same as it was :(

2013-03-13 22_26_45-Re_ Why can't I run a script in PyCharm, when I can debug it_ I get CreateProces.png

2013-03-13 22_28_59-Re_ Why can't I run a script in PyCharm, when I can debug it_ I get CreateProces.png
Here are my log files in case they help.
log.zip (27KB)
Hi Dmitry. Do you have any more suggestions please? I have tried multiple re-installs with no joy, and I'm out of ideas. Thanks!
Hello Dmitry - any response on this please? It's still a problem.
Hi Trevor! I see a lot of:
"Cannot run program "C:/Python27/python.exe" (in directory "C:\Python27"): CreateProcess error=2, The system cannot find the file specified "
in logs.

Definitely something wrong happened to your environment.

Can you manually launch python.exe?
Probably some environment variables are not set appropriately.
Please reinstall python on your machine.The directory with python installed and all its files should have appropriate rwx access mode for your user.

After that run PyCharm... go to  Settings | Project Interprreters | Python Interpreters.
Add your newly installed python interpreter, and set it as project interpreter in Settings | Project Interprreters

I hope it will work for you.
I'm sorry to say it's actually got worse: PyCharm won't even run now! It hangs during startup. The machine is generally ok: running ms office, visual studio, and allowing me to develop in python using notepad / idle etc.

Don't worry about it Dmitry. I'd say it's something to do with my setup rather than PyCharm itself. When I have time I'll have another go at it and try to get as close to a fresh install as possible. Thanks for you help anyway.

@Trevor Jobling,this is very old but for what its worth,  i fixed this by editing the workspace.xml file inside the repo i was workign on. It was pointing to an invalid python location:
file located here: "<local project location>\.idea\workspace.xml"

the script that wouldnt work was test_scripts.py. "SDK home" was pointing to an old location of python. i found this with a control+f of the error path

<configuration name="test_scripts" type="PythonConfigurationType" factoryName="Python" temporary="true">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<env name="PYTHONUNBUFFERED" value="1" />
<option name="SDK_HOME" value="C:\ProgramData\Anaconda2\python.exe" />


Thanks for the suggestion Ryan. I'm not using Python these days but hopefully somebody will find that useful. Thanks for sharing!


@Ryan Elfman: Thanks! This solved this exact problem I have been having after I renamed some folders and launched PyCharm.


Well done Ryan - I'm delighted to see your helpful comment on a stale thread prove to be useful! :)


Hey, you never know when a PyCharm newbie may need help!


Glad i could help!


Hello, there must be a better way than manually change things on workspace.xml ... 


Try going to the edit configuration section on top right corner. 

select edit configuration 

change the python interpreter to the root python directory "python.exe" file (where you have installed the python at first)

Hope this helps!



Ryan Elfman Thanks, saved me as well :)


This isn't working for me

I have tried changing the SDK_HOME value and the interpreter.


Hello Chidansh El


Perhaps, I can assist. Could you please share a screenshot of the Run Configuration and describe the problem? 


THe solution was: make again a new run  config.

This is a problem when you save your setting from github and this config not works now in your local project, please fix this 


Even after updating it on the IDE config window it did not work.
Updating to the correct path/python-version on '.idea/workspace.xml' file worked! Thx Ryan Elfman!


Please sign in to leave a comment.