when i type command jupyter notebook list, the outputs are as follows:
http://localhost:8888/?token=a21aae4b484b7087c91f5d161c1fd595a76f05b0fc2204c8 :: C:\06Codes_From_Jupyter
http://localhost:8888/?token=3e6a9a390cc121315ccb7565c287ef6ed6bddd6ec66c9ed2 :: C:\06Codes_From_Jupyter
http://localhost:8888/?token=d53af56195ba09b1156ea7a42e86ff574c8a8ee44731db5b :: C:\06Codes_From_Jupyter
http://localhost:8889/?token=1f1250e4cdf841e6162591fce9c16769266b21f3e152a42c :: C:\06Codes_From_Jupyter
In fact, when i paste http://localhost:8888/?token=a21aae4b484b7087c91f5d161c1fd595a76f05b0fc2204c8 into the chrome broswer, i fail to open the address.
but I don't know how to close the runing servers?
Beside,when i start the jupyter notebook app, the new created servering, whose port are still 8888.Then I start the other jupyter notebook app, its port are 8889.
so, I don't know what there happen?
Each server should start on a new port. jupyter notebook list is reading a set of data files - each notebook server you run writes a file when it starts up, and attempts to remove it when it shuts down. If you see different listed servers on the same port, that means some of them exited without being able to remove the file they made.
If you launch the notebook from a command prompt, you can shut it down by pressing Ctrl-C in that same command prompt. If not, you can run jupyter notebook stop 8888.
I get an Access Denied error when running jupyter notebook stop 8888 on Win10.
os.kill(server['pid'], signal.SIGTERM)
PermissionError: [WinError 5] Access is denied
Tried running jupyter notebook stop 8888 in Administrator mode, still got the error.
Any suggestions on how I can stop the running notebook servers on Win10? (Other than a system restart)
If you still have the command prompt where you started them, try Ctrl-C or Ctrl-Break. If not, it's possible by making an HTTP post request to /api/shutdown. We know that's not ideal, we do plan to have a better way.
Pull request #3000 should fix jupyter notebook stop on Windows.
I just submitted a PR that introduces a new server option that will add a "shutdown" button next to the "logout" button: https://github.com/jupyter/notebook/pull/3004
In windows you can also just kill from task manager.
Hello,
I'm kind of facing to the same issue.
I have all those servers opened (Maybe it's not the right work, I'm beginner) :
http://localhost:8890/?token=4322ab537d86c86a206e6a63c05137fc9c388dd2d425890e :: C:\Users\test
http://localhost:8888/?token=7d7bd406465f34b5d491432bd7e231f980463ba5fb3bb1d6 :: C:\Users\test
http://localhost:8890/?token=dd8df31466fee972a9dec340c9792cf73eaddab14d280b31 :: C:\Users\test
http://localhost:8889/?token=7afae4454280bed0ccdd786c635d59f1002050475b5ea76a :: C:\Users\test
Everytime I try to shut them down with thi following command :
jupyter notebook stop 8888
I get this error.
Shutting down server on port 8888 ...
Traceback (most recent call last):
File "C:\Users\test\Anaconda3\Scripts\jupyter-notebook-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\test\Anaconda3\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\test\Anaconda3\lib\site-packages\traitlets\config\application.py", line 658, in launch_instance
app.start()
File "C:\Users\test\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1571, in start
super(NotebookApp, self).start()
File "C:\Users\test\Anaconda3\lib\site-packages\jupyter_core\application.py", line 255, in start
self.subapp.start()
File "C:\Users\test\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 451, in start
if not self.shutdown_server(server):
File "C:\Users\test\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 442, in shutdown_server
return shutdown_server(server, log=self.log)
File "C:\Users\test\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 402, in shutdown_server
HTTPClient().fetch(req)
File "C:\Users\test\Anaconda3\lib\site-packages\tornado\httpclient.py", line 102, in fetch
self._async_client.fetch, request, **kwargs))
File "C:\Users\test\Anaconda3\lib\site-packages\tornado\ioloop.py", line 458, in run_sync
return future_cell[0].result()
File "C:\Users\test\Anaconda3\lib\site-packages\tornado\concurrent.py", line 238, in result
raise_exc_info(self._exc_info)
File "<string>", line 4, in raise_exc_info
ConnectionRefusedError: [Errno 10061] Unknown error
I dont know what to do, I tried to find the task on the task manager but i couldnt.
Thank you by advance
That might happen if those servers have crashed, so they're not running but the info file that records them hasn't been cleaned up.
Try restarting the computer and running jupyter notebook list again. If there are still servers there, you can remove the files from the runtime directory (run jupyter --paths to see where that is on your system).
Hello !
It perfectly worked !!! That's exactly what I needed , the path of the runtime files. I couldnt find it...
So i cleared the runtime directory and now I can shutdown the servers with any issue.
Thank you so much
Hello,
When I run jupyter notebook list, I get this:
http://localhost:8889/?token=blah :: /Users/me/storyfit/data-mining/research
http://localhost:8891/?token=blah2 :: /Users/me/storyfit/data-mining
http://localhost:8890/?token=blah23 :: /Users/me/storyfit/data-mining/research
http://localhost:8888/?token=blah54 :: /Users/me/storyfit/data-mining/research
(I've anonymized the tokens.)
I thought I should be able to kill these notebook servers usingjupyter notebook stop 8888, but when I try that, I get the following:
Shutting down server on port 8888 ...
Traceback (most recent call last):
File "/Users/Mark/anaconda3/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 596, in launch_instance
app.start()
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 1571, in start
super(NotebookApp, self).start()
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 255, in start
self.subapp.start()
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 451, in start
if not self.shutdown_server(server):
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 442, in shutdown_server
return shutdown_server(server, log=self.log)
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/notebook/notebookapp.py", line 402, in shutdown_server
HTTPClient().fetch(req)
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/tornado/httpclient.py", line 102, in fetch
self._async_client.fetch, request, **kwargs))
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/tornado/ioloop.py", line 453, in run_sync
return future_cell[0].result()
File "/Users/Mark/anaconda3/lib/python3.5/site-packages/tornado/concurrent.py", line 232, in result
raise_exc_info(self._exc_info)
File "<string>", line 3, in raise_exc_info
tornado.httpclient.HTTPError: HTTP 404: Not Found
This seems to be very related to the questions above, but I'm struggling to figure out why I'm not able to stop the notebook servers. Any help much appreciated!!! Thanks
For what it's worth, when I try to go to those pages in Chrome, I can't access the notebooks in browser:

The entries in the list can be left there erroneously if the server has exited without being able to clear up its files. Though in that case you should get a connection error instead of a 404.
If you think that's what's happened, and the servers are no longer running, you can clean up the files in the runtime directory (use jupyter --paths to see where that is).
$ jupyter notebook stop 8888
Gives this error:
[C 02:02:07.518 NotebookApp] No such file or directory: /home/tox/stop
This is ubuntu 16.04
tox@lrndsvm:$ jupyter notebook --version
5.0.0
tox@lrndsvm:$ jupyter --version
4.3.0
tox@lrndsvm:~$
Try updating the notebook package to a newer version. I think stop was added since 5.0.
This might help:
first, run jupyter notebook list to get jupyter used port-number.
then,run lsof -n -i4TCP:[port-number]to get PID, The PID is the second field in the output.
finally, run kill -9 [PID]to kill this process.
In the next release (5.5), there will be an option to display a "Quit" button in the dashboard, allowing users without terminal/SSH access to stop a notebook server (https://github.com/jupyter/notebook/pull/3004).
(And this option is on by default)
Have you tried by executing the command prompt as admin?
Our jupyter runing pyspark code had no answer, it is so so so slowly just run print(1+2),there is no result in 4 hours銆侶ow can i restart the jupyter on server?
We can run code in cluster use pyspark.
The way I solved it:
jupyter --pathsrm -r [path to runtime folder]/*top if there are any jupyter notebook running processes left, and if so kill their PID.top | grep jupyter &kill [PID]jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root &Does jupyter notebook stop support stopping a Jupyter notebook configured with SSL?
I launched my jupyter notebook in SSL mode by providing a key and perm file. But when I used jupyter notebook stop $PORT to stop jupyter, I got the following:
Shutting down server on port 8443 ...
[W 01:55:02.120 NotebookApp] SSL Error on 11 ('127.0.0.1', 8443): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
Traceback (most recent call last):
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/jupyter_core/application.py", line 266,in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/notebook/notebookapp.py", line 1671, instart
super(NotebookApp, self).start()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/jupyter_core/application.py", line 255,in start
self.subapp.start()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/notebook/notebookapp.py", line 460, in start
if not self.shutdown_server(server):
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/notebook/notebookapp.py", line 451, in shutdown_server
return shutdown_server(server, log=self.log)
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/notebook/notebookapp.py", line 411, in shutdown_server
HTTPClient().fetch(req)
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/httpclient.py", line 119, in fetch
self._async_client.fetch, request, **kwargs))
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/ioloop.py", line 576, in run_sync
return future_cell[0].result()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/simple_httpclient.py", line 272, in run
max_buffer_size=self.max_buffer_size)
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/tcpclient.py", line 242, in connect
server_hostname=host)
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/site-packages/tornado/iostream.py", line 1501, in _do_ssl_handshake
self.socket.do_handshake()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:841)
I think it's because it's trying to access localhost with http instead of https. Is there a way to configure it to use https?
This might help:
first, runjupyter notebook listto get jupyter used port-number.
then,runlsof -n -i4TCP:[port-number]to get PID, The PID is the second field in the output.
finally, runkill -9 [PID]to kill this process.
It worked for me, thank you :)
I am having a problem while using the command jupyter notebook stop with my SSL certificate. This is the error I get:
$ jupyter notebook stop
Shutting down server on port 8888 ...
[W 19:12:06.941 NotebookApp] SSL Error on 11 ('127.0.0.1', 8888): [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1051)
Traceback (most recent call last):
File "/home/sharif/anaconda3/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/home/sharif/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/sharif/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 658, in launch_instance
app.start()
File "/home/sharif/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 1758, in start
super(NotebookApp, self).start()
File "/home/sharif/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 255, in start
self.subapp.start()
File "/home/sharif/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 456, in start
if not self.shutdown_server(server):
File "/home/sharif/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 447, in shutdown_server
return shutdown_server(server, log=self.log)
File "/home/sharif/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 407, in shutdown_server
HTTPClient().fetch(req)
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/httpclient.py", line 119, in fetch
self._async_client.fetch, request, **kwargs))
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/ioloop.py", line 576, in run_sync
return future_cell[0].result()
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/simple_httpclient.py", line 272, in run
max_buffer_size=self.max_buffer_size)
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/tcpclient.py", line 242, in connect
server_hostname=host)
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/sharif/anaconda3/lib/python3.7/site-packages/tornado/iostream.py", line 1501, in _do_ssl_handshake
self.socket.do_handshake()
File "/home/sharif/anaconda3/lib/python3.7/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1051)
I recommend looking on StackOverflow, etc. for help regarding self-signed certificates
If you launch the notebook from a command prompt, you can shut it down by pressing Ctrl-C in that same command prompt.
Will simply killing the process in the command prompt as recommended above cause any problems? Will this perform a full clean up鈥攄eleting temporary files, etc.?
Ctrl-C sends SIGINT, which Jupyter catches and does cleanup. In fact, you now to have to confirm shutdown after pressing Ctrl-C.
If you hard-kill it (SIGKILL, kill -9), things won't be cleaned up. In particular, an info file will be left behind that's used by jupyter notebook list.
how about SIGTERM, is that okay as well?
Incidentally, will jupyter notebook list work for jupyter lab servers?
Because when I execute the jupyter notebook stop 8888 command, I get SSL: CERTIFICATE_VERIFY_FAILED errors. (though that's most likely a different problem, I guess).
The way I solved it:
- Check where your runtime folder is located:
jupyter --paths- Remove all files in the runtime folder:
rm -r [path to runtime folder]/*- Check with
topif there are any jupyter notebook running processes left, and if sokilltheir PID.
top | grep jupyter &
kill [PID]- Then relaunch your notebook on the desired ip and port:
jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root &
WORKS
The way I solved it:
- Check where your runtime folder is located:
jupyter --paths- Remove all files in the runtime folder:
rm -r [path to runtime folder]/*- Check with
topif there are any jupyter notebook running processes left, and if sokilltheir PID.
top | grep jupyter &
kill [PID]- Then relaunch your notebook on the desired ip and port:
jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root &
This works for windows too. Thanks
This might help:
first, runjupyter notebook listto get jupyter used port-number.
then,runlsof -n -i4TCP:[port-number]to get PID, The PID is the second field in the output.
finally, runkill -9 [PID]to kill this process.
Works for me.
Boiled it down to
TARGET_PORT=8888
kill -9 $(lsof -n -i4TCP:$TARGET_PORT | cut -f 2 -d " ")
On unix/Mac here is a snippet to kill all processes with "jupyter" in their name:
ps -Af | grep jupyter | grep -v grep | awk '{print $2}' | xargs kill -9
As mentioned above, sending SIGKILL (via kill -9) won't trigger Notebook's signal handler so that it can clean up other resources - in particular, the graceful shutdown of any active kernels - as well as the server info previously referenced.
Instead -9 should be replaced with -15 (SIGTERM) or dropped altogether since SIGTERM is the default signal issued by kill.
This issue is nearly 2.5 years old and contains some great advice, yet nothing that appears to require changes. As such, I think it's best we close this. If anyone has an issue we'll be happy to reopen it at that time.
Thanks @gertjandemulder
Here's a bash script to keep it simple (killing all ports exept 8888). Hope this help !

`
ports=jupyter notebook list | awk -F[:/] '{print $5}'
for port in $ports
do
PORT=$(echo $port | xargs)
if [ "$PORT" != "8888" ]; then
kill -9 $(lsof -n -i4TCP:$port | cut -f 2 -d " ")
else
echo "Notebooks on port '$PORT' are still running ..."
fi
done
`
Most helpful comment
Each server should start on a new port.
jupyter notebook listis reading a set of data files - each notebook server you run writes a file when it starts up, and attempts to remove it when it shuts down. If you see different listed servers on the same port, that means some of them exited without being able to remove the file they made.If you launch the notebook from a command prompt, you can shut it down by pressing Ctrl-C in that same command prompt. If not, you can run
jupyter notebook stop 8888.