0

I try opening Spyder and I get the following error regarding the Kernel, I have just tried many solutions that were posted in similar threads but I still cannot fix the problem. I also removed Anaconda, and Spyder, and re-installed everything, with no success.

Please help.

Thank you !

An error ocurred while starting the kernel
Traceback (most recent call last):
File "C:\Users\7265\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\7265\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\7265\Anaconda3\lib\site‑packages\spyder_kernels\console\__main__.py", line 11, in 
start.main()
File "C:\Users\7265\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 289, in main
import_spydercustomize()
File "C:\Users\7265\Anaconda3\lib\site‑packages\spyder_kernels\console\start.py", line 39, in import_spydercustomize
import spydercustomize
File "C:\Users\7265\Anaconda3\lib\site‑packages\spyder_kernels\customize\spydercustomize.py", line 24, in 
from IPython.core.getipython import get_ipython
File "C:\Users\7265\Anaconda3\lib\site‑packages\IPython\__init__.py", line 56, in 
from .terminal.embed import embed
File "C:\Users\7265\Anaconda3\lib\site‑packages\IPython\terminal\embed.py", line 14, in 
from IPython.core.magic import Magics, magics_class, line_magic
File "C:\Users\7265\Anaconda3\lib\site‑packages\IPython\core\magic.py", line 20, in 
from . import oinspect
File "C:\Users\7265\Anaconda3\lib\site‑packages\IPython\core\oinspect.py", line 30, in 
from IPython.lib.pretty import pretty
File "C:\Users\7265\Anaconda3\lib\site‑packages\IPython\lib\pretty.py", line 82, in 
import datetime
File "C:\Users\7265\datetime.py", line 8, 
in 
from datetime import timedelta as delta

ImportError: cannot import name 'timedelta' from 'datetime' (C:\Users\7265\datetime.py)
  • Seems like the bottom got cut off. You can [edit] to fix it. BTW welcome to SO! Check out the [tour] and [ask] if you want advice. – wjandrea May 18 '20 at 18:02
  • Done, thanks @wjandrea – Jose Morfin May 18 '20 at 18:15
  • 1
    Is your Python script named `datetime.py` by any chance? – Prateek Dewan May 18 '20 at 18:17
  • Does this answer your question? [Importing installed package from script raises "AttributeError: module has no attribute" or "ImportError: cannot import name"](https://stackoverflow.com/questions/36250353/importing-installed-package-from-script-raises-attributeerror-module-has-no-at) – wjandrea May 18 '20 at 18:19
  • datetime should be under `C:\Users\7265\Anaconda3\lib` somewhere, so it looks like you have a script called "datetime.py" that's causing the problem. – wjandrea May 18 '20 at 18:21

0 Answers0