问题
I have a problem with the Spyder software of Python(version 4.0.1) regarding the running kernels in the IPython Console. Accordingly, I have tried many ways to resolve the issue like running some commands in Anaconda prompt or set the settings to the default mode. I even updated the version of my anaconda and the spyder. Nevertheless, nothing has been changed and the issue still exists.
This is the error I am receiving:
Traceback (most recent call last): File "C:\ProgramData\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\ProgramData\Anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console__main__.py", line 11, in start.main() File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 287, in main import_spydercustomize() File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 39, in import_spydercustomize import spydercustomize File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 24, in from IPython.core.getipython import get_ipython File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython__init__.py", line 56, in from .terminal.embed import embed File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\terminal\embed.py", line 14, in from IPython.core.magic import Magics, magics_class, line_magic File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\core\magic.py", line 20, in from . import oinspect File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\core\oinspect.py", line 30, in from IPython.lib.pretty import pretty File "C:\ProgramData\Anaconda3\lib\site‑packages\IPython\lib\pretty.py", line 82, in import datetime File "C:\Users\mahkam\datetime.py", line 4 ^ SyntaxError: EOF while scanning triple‑quoted string literal
回答1:
(Spyder maintainer here) You need to rename or remove this file
C:\Users\mahkam\datetime.py
That's because that file is using the same name of Python internal module and that confuses other modules that depend on it.
回答2:
Looks like you have a quoting error
File "C:\Users\mahkam\datetime.py", line 4 ^ SyntaxError: EOF while scanning triple‑quoted string literal
Check out your datetime.py
来源:https://stackoverflow.com/questions/60568931/problem-with-running-kernel-in-ipython-console