jupyter / jupyter/notebook

Jupyter notebook will not close

Open
#2,832 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
13.3k
Forks
5.8k
Avg merge
6d 11h
Merged PRs (30d)
7

Description

I am using macOS. So I was trying to install jupyter_contrib_nbextensions and then it told me I had a Jupyter notebook server running, which I clearly did not have - I always exit using Ctrl+C.

Then I tried `jupyter notebook list`, it did show `Currently running servers: http://localhost:8888/ :: /Users/huyiqun`. But if I try to open localhost:8888 in my browser, the page cannot be reached. I also tried to reopen jupyter notebook through terminal, and close again using Ctrl+C. It did not solve the problem.

Not sure if this helps diagnosing the problem, but here is the output from when I started a notebook till I closed the process:

```
Agness-MacBook-Air:~ huyiqun$ jupyter notebook
[I 23:37:57.591 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[W 23:37:58.414 NotebookApp] Error loading server extension jupyter_nbextensions_configurator
Traceback (most recent call last):
File "/Users/huyiqun/anaconda2/lib/python2.7/site-packages/notebook/notebookapp.py", line 1271, in init_server_extensions
mod = importlib.import_module(modulename)
File "/Users/huyiqun/anaconda2/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named jupyter_nbextensions_configurator
[I 23:37:59.668 NotebookApp] [nb_anacondacloud] enabled
[I 23:37:59.673 NotebookApp] [nb_conda] enabled
[I 23:37:59.748 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 23:37:59.748 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named nbbrowserpdf.exporters.pdf
[I 23:37:59.763 NotebookApp] Serving notebooks from local directory: /Users/huyiqun
[I 23:37:59.763 NotebookApp] 0 active kernels
[I 23:37:59.763 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=ccd51a7a564708fb212d9bd857f1ee1714c6b4735970a1c2
[I 23:37:59.763 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 23:37:59.765 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=ccd51a7a564708fb212d9bd857f1ee1714c6b4735970a1c2
[I 23:38:00.194 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[W 23:38:00.868 NotebookApp] 404 GET /nbextensions/nbextensions_configurator/tree_tab/main.js?v=20170906233757 (::1) 22.04ms referer=http://localhost:8888/tree
^C[I 23:38:08.803 NotebookApp] interrupted
Serving notebooks from local directory: /Users/huyiqun
0 active kernels
The Jupyter Notebook is running at: http://localhost:8888/?token=ccd51a7a564708fb212d9bd857f1ee1714c6b4735970a1c2
Shutdown this notebook server (y/[n])? ^C[C 23:38:10.465 NotebookApp] received signal 2, stopping
[I 23:38:10.467 NotebookApp] Shutting down kernels
```
And then by `jupyter notebook list`, it shows
```
Currently running servers:
http://localhost:8888/ :: /Users/huyiqun
```
The installer of nbextensions also detects a running server.

Thanks for the help!

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Reproduce the behavior with `jupyter notebook`, Ctrl+C, and `jupyter notebook list`, then trace the server shutdown and listing behavior shown by the terminal output. Done means a deliberately stopped server is no longer reported as running and the stale localhost entry is cleared.

Written by the indexing model from the issue text.

Assessment

Tech stack
anaconda, jupyter-notebook, python
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.