在安裝 pythonxy 后,使用 spyder 一切正常,突然有一天

無論運行什么代碼都會出現:
>>> runfile('D:/PythonWorkspace/abc.py', wdir='D:/PythonWorkspace')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'runfile' is not defined
但是在 IDLE 中 python 還是正常的,就是不能在 spyder 中運行任何一個檔案。
望有識之士幫忙,我不想重新做系統了。
uj5u.com熱心網友回復:
打開 Tools/Preferences 選擇Run標簽頁,選中"Execute in a new dedicated Python interpreter,這樣的方法能暫時運行,但是在python consloe 和Ipython consloe中還是提示NameError: name 'runfile' is not defineduj5u.com熱心網友回復:
樓主解決了嗎,我也是一樣的問題,想著實在不行的話就把anaconda卸了重下,但是實在舍不得啊,那么多的包uj5u.com熱心網友回復:
你選中所有代碼,滑鼠右鍵點擊Run Cell才是運行的按鈕轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/133996.html
上一篇:小白求助!!Python題!!!
下一篇:MCKD處理的引數選擇
