Jupyter notebook kernel won't launch
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 13.3k
- Forks
- 5.8k
- Avg merge
- 6d 11h
- Merged PRs (30d)
- 7
Description
Jupyter notebook kernel keeps dying, even after anaconda reinstall
Original StackExchange post
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:37:02.432 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:37:05.443 NotebookApp] KernelRestarter: restart failed
[W 16:37:05.443 NotebookApp] Kernel 0d506195-c877-47d7-a8e5-6c05a6586226 died, removing from map.
[W 16:37:45.191 NotebookApp] Timeout waiting for kernel_info reply from fb5aad60-63d4-4fad-8d98-59e11e1b27b9
[E 16:37:45.192 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: fb5aad60-63d4-4fad-8d98-59e11e1b27b9)
[E 16:37:45.193 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: fb5aad60-63d4-4fad-8d98-59e11e1b27b9)
[W 16:37:50.428 NotebookApp] Timeout waiting for kernel_info reply from 0d506195-c877-47d7-a8e5-6c05a6586226
[E 16:37:50.428 NotebookApp] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 0d506195-c877-47d7-a8e5-6c05a6586226)
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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository file or test is named in the report. Start by reproducing the failure with jupyter-notebook and follow the kernel traceback, including the local inspect.py shown in the report; done means a new notebook kernel launches without restarting or timing out.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- anaconda, jupyter-notebook, pandas, python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100