Spyder Console - Error ocurred while starting the Kernel

那年仲夏 提交于 2021-02-17 06:23:05

问题


Spyder console is showing an error msg:

An error ocurred while starting the kernel

Traceback (most recent call last): File "C:\Users\ABCD\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\Users\ABCD\Anaconda3\lib\runpy.py", 
line 85, in _run_code exec(code, run_globals) File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\console\__main__.py",
line 11, in start.main() File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", 
line 287, in main import_spydercustomize() File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", 
line 39, in import_spydercustomize import spydercustomize File "C:\Users\ABCD\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", 
line 27, in from IPython.core.getipython import get_ipython File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\__init__.py", 
line 55, in from .terminal.embed import embed File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\terminal\embed.py", 
line 17, in from IPython.terminal.ipapp import load_default_config File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\terminal\ipapp.py", 
line 28, in from IPython.core.magics import ( File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\core\magics\__init__.py",
line 18, in from .code import CodeMagics, MacroToEdit File "C:\Users\ABCD\Anaconda3\lib\site‑packages\IPython\core\magics\code.py", 
line 23, in from urllib.request import urlopen File "C:\Users\ABCD\Anaconda3\lib\urllib\request.py", 
line 86, in import email File "C:\Users\ABCD\email.py", 
line 8, in n=input() EOFError: EOF when reading a line

What I understood on reading other threads about similar kind of problems , that this is due to having two python versions installed

So, I tried manually removing all python files (as I was unable to uninstall python) and then uninstalled and reinstalled anaconda (spyder) but the problem persists

Any kind of help wd be appreciated


回答1:


Short answer: To fix this problem, you need to remove or rename this file:

C:\Users\ABCD\email.py

Long answer: That file has the same name of a core Python module. Since it's placed in your home directory, it has higher priority than that module, which makes Python to use it first and ends up causing the error.



来源:https://stackoverflow.com/questions/58197276/spyder-console-error-ocurred-while-starting-the-kernel

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