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.
Trevor
PyCharm 2.7.1.
Windows 7 64bit
Python 2.7
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.
Trevor
PyCharm 2.7.1.
Windows 7 64bit
Python 2.7
Please sign in to leave a comment.
log.zip (27KB)
"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.
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" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<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!
WORKED FOR ME
@... 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!