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() ?

George Bora
  • 1,618
  • 6
  • 26
  • 45

1 Answers1

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.

George Bora
  • 1,618
  • 6
  • 26
  • 45
  • 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. – Demis Dec 22 '15 at 23:03