2

I've just recently installed Python(x,y) 2.7.5.1 on my computer with no other Python distributions installed in parallel and I have a problem with the Spyder IDE.

Namely when I create a script even a simple:

print "Hello World"

and I try to run it via the usual Runfile/F5 I get the following error:

name 'runfile' is not defined

As the button seems to be trying to use a runfile() function to run the scripts I create in the IDE.

If I try to run the same scripts by hand in Spyder's console with execfile() it works.

My question is how do I get the standard Run button and implicitly runfile() to work or alternatively to redirect the Run button to use execfile() ?

1 Answer 1

1

The problem seems to go away if from the run configuration I choose the option that each script be executed in it's own new individual console.

Sign up to request clarification or add additional context in comments.

1 Comment

This also solved my problem for running PythonXY(v2.7.10.0)/Spyder scripts on WinXP, when running the Script in the Current interpreter would just hang after runfile(), requiring me to Force-End the python.exe process.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.