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

success when debugging.png

error when running.png

interpreter settings.png
11 comments
Could you please attach a screenshot of your run configuration settings?
0
Please try going to Settings | Python Interpreters, deleting and recreating your Python interpreter. This should solve the problem.
0
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
0
Here are my log files in case they help.
log.zip (27KB)
0
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!
0
Hello Dmitry - any response on this please? It's still a problem.
0
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.
0
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.
0

@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" />

0

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

0

Please sign in to leave a comment.