Jupyter notebook kernel keeps dying, even after anaconda reinstall

0

I use Jupyter Notebook every day for data analysis. This morning, after opening a brand new notebook file, the kernel failed to initialize. Now, every time I try to open a juptyer notebook, the kernel dies until it times out.

I tried everything I could think of, including completely reinstalling anaconda, but it didn't work. I'm now completely without options and unable to do my day-to-day work.

EDIT:

I opened jupyter notebook like always with

jupyter-notebook

The Jupyter app opens to the home page like usual and prints the following output:

[I 16:22:51.502 NotebookApp] Serving notebooks from local directory: C:\Users\cmhack0114
[I 16:22:51.502 NotebookApp] The Jupyter Notebook is running at:
[I 16:22:51.502 NotebookApp] http://localhost:8888/?token=0f5b4f4c50f6daa7c5261db202c14c9a45f9338be7020214
[I 16:22:51.502 NotebookApp]  or http://127.0.0.1:8888/?token=0f5b4f4c50f6daa7c5261db202c14c9a45f9338be7020214
[I 16:22:51.502 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:22:51.565 NotebookApp]

To access the notebook, open this file in a browser:
    file:///C:/Users/cmhack0114/AppData/Roaming/jupyter/runtime/nbserver-12424-open.html


 Or copy and paste one of these URLs:
        http://localhost:8888/?token=0f5b4f4c50f6daa7c5261db202c14c9a45f9338be7020214
     or http://127.0.0.1:8888/?token=0f5b4f4c50f6daa7c5261db202c14c9a45f9338be7020214
[E 16:22:52.884 NotebookApp] Could not open static file ''
[W 16:22:52.921 NotebookApp] 404 GET /static/components/react/react-dom.production.min.js (::1) 5.98ms referer=http://localhost:8888/tree?token=0f5b4f4c50f6daa7c5261db202c14c9a45f9338be7020214
[W 16:22:52.958 NotebookApp] 404 GET /static/components/react/react-dom.production.min.js (::1) 2.02ms referer=http://localhost:8888/tree?token=0f5b4f4c50f6daa7c5261db202c14c9a45f9338be7020214

When I try to open any new notebook, the kernel fails and prints the following five times (apparently it retries five times). Only pasting one below for brevity.

[I 16:26:07.064 NotebookApp] KernelRestarter: restarting kernel (3/5), new random ports
Traceback (most recent call last):
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\IPython\__init__.py", line 54, in <module>
    from .core.application import Application
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\IPython\core\application.py", line 23, in <module>
    from traitlets.config.application import Application, catch_config_error
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\traitlets\__init__.py", line 1, in <module>
    from .traitlets import *
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\traitlets\traitlets.py", line 44, in <module>
    import inspect
  File "C:\Users\cmhack0114\OneDrive - CBS Corporation\My Files\Stories\Active\2019-08-27 school support services\nb\inspect.py", line 1, in <module>
    import pandas as pd
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\__init__.py", line 55, in <module>
    from pandas.core.api import (
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\api.py", line 24, in <module>
    from pandas.core.groupby import Grouper, NamedAgg
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
    from pandas.core.groupby.generic import (  # noqa: F401
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\groupby\generic.py", line 44, in <module>
    from pandas.core.frame import DataFrame
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\frame.py", line 88, in <module>
    from pandas.core.generic import NDFrame, _shared_docs
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\generic.py", line 123, in <module>
    class NDFrame(PandasObject, SelectionMixin):
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\generic.py", line 1179, in NDFrame
    def rename_axis(self, mapper=sentinel, **kwargs):
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\util\_decorators.py", line 223, in decorate
    kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
AttributeError: module 'inspect' has no attribute 'Parameter'
[I 16:26:10.066 NotebookApp] KernelRestarter: restarting kernel (4/5), new random ports
Traceback (most recent call last):
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\ipykernel_launcher.py", line 15, in <module>
    from ipykernel import kernelapp as app
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\ipykernel\__init__.py", line 2, in <module>
    from .connect import *
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\ipykernel\connect.py", line 13, in <module>
    from IPython.core.profiledir import ProfileDir
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\IPython\__init__.py", line 54, in <module>
    from .core.application import Application
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\IPython\core\application.py", line 23, in <module>
    from traitlets.config.application import Application, catch_config_error
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\traitlets\__init__.py", line 1, in <module>
    from .traitlets import *
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\traitlets\traitlets.py", line 44, in <module>
    import inspect
  File "C:\Users\cmhack0114\OneDrive - CBS Corporation\My Files\Stories\Active\2019-08-27 school support services\nb\inspect.py", line 1, in <module>
    import pandas as pd
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\__init__.py", line 55, in <module>
    from pandas.core.api import (
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\api.py", line 24, in <module>
    from pandas.core.groupby import Grouper, NamedAgg
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
    from pandas.core.groupby.generic import (  # noqa: F401
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\groupby\generic.py", line 44, in <module>
    from pandas.core.frame import DataFrame
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\frame.py", line 88, in <module>
    from pandas.core.generic import NDFrame, _shared_docs
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\generic.py", line 123, in <module>
    class NDFrame(PandasObject, SelectionMixin):
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\core\generic.py", line 1179, in NDFrame
    def rename_axis(self, mapper=sentinel, **kwargs):
  File "C:\Users\cmhack0114\AppData\Local\Continuum\anaconda3\envs\dayturns\lib\site-packages\pandas\util\_decorators.py", line 223, in decorate
    kind = inspect.Parameter.POSITIONAL_OR_KEYWORD
AttributeError: module 'inspect' has no attribute 'Parameter'
[W 16:26:13.061 NotebookApp] KernelRestarter: restart failed
[W 16:26:13.061 NotebookApp] Kernel e767f7c9-5dbb-48a0-8477-11bbe7ae1032 died, removing from map.

This happens no matter what I do. I've tried a fresh env, running it on a different browser, creating a new nb file, a complete new anaconda install. Nothing has worked.

For what it's worth, this is a corporate computer at a very large company. However due to the nature of my work (TV newsroom, not a lot of people doing this kind of thing in journalism) there really isn't anyone at my organization with the skills to help me fix this.

Also, I was using a module imported from a local file using importlib. I seriously doubt this would cause this, but it's the only thing I was doing that was unusual today. Here's the code for that.

import importlib.util as util
spec = util.spec_from_file_location('module.name', Path.cwd() / 'inspect.py') 
inspect = util.module_from_spec(spec)
spec.loader.exec_module(inspect) 

hackerlikecomputer

Posted 2019-08-27T21:03:10.630

Reputation: 1

No answers