Spyder 'runfile' is not defined

自古美人都是妖i 提交于 2019-12-12 03:04:11

问题


I am trying to run a script in Spyder, but am getting the following error:

NameError: name 'runfile' is not defined.

I tried a variety of things, like updating the PYTHONPATH variable, but nothing seems to be helping.
I have Python 2.7, Anaconda 2.4, and Spyder 2.3.8. I have my PYTHONPATH set to:

C:\anaconda\\...\externalshell

回答1:


The source of this was an issue with the import of sitecustomize. This was apparent when you clicked on All Programs>Anaconda>Anaconda Prompt in the Windows Start Menu. This entry offered some insight with that: How to reset Spyder IDE (Python 2.7) graphic user interface?

Essentially, go to a command prompt (cmd in Windows) and type the following:

spyder --reset
spyder --default

This resolved the underlying sitecustomize issue, which fixed the 'runfile' is not defined error.



来源:https://stackoverflow.com/questions/38250361/spyder-runfile-is-not-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!