Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error "Unable to open Jupyter Notebook: Port 8888 is already in use"

I am getting following error when I run Jupyter Notebook:

(base) C:\Users\ramne>jupyter notebook
[I 01:19:00.648 NotebookApp] The port 8888 is already in use, trying another port.

And when I do netstat -ano | find Str "8888" , I get the following:

C:\Users\ramne>netstat -ano | findStr "8888"
TCP    127.0.0.1:8888         0.0.0.0:0              LISTENING       16024
TCP    [::1]:8888             [::]:0                 LISTENING       16024

I don't know what the default connection of port 8888 is or what its behavior should be like. How do I fix this error so I can open Jupyter Notebook?

like image 338
Ramneek Singh Kakkar Avatar asked Aug 08 '18 05:08

Ramneek Singh Kakkar


People also ask

Why is port 8888 already in use?

A 'port' is basically an address on your computer. By default, Jupyter uses port 8888 to let you talk to it (you can see this in the URL when you're looking at a notebook: localhost:8888 ). If you're already running a server, it will try 8889 , then 8890 , then 8891 and so on, until it finds an opening.

Why my jupyter notebook is not opening?

Jupyter doesn't load or doesn't work in the browserTry disabling any browser extensions and/or any Jupyter extensions you have installed. Some internet security software can interfere with Jupyter. If you have security software, try turning it off temporarily, and look in the settings for a more long-term solution.

How do I set the port on a jupyter notebook?

Once the console shows, type the following: remoteuser@remotehost: jupyter notebook --no-browser --port=XXXX # Note: Change XXXX to the port of your choice. Usually, the default is 8888. # You can try 8889 or 8890 as well.

What port does jupyter notebook use?

99.9% of the time Jupyter will run on port 8888. Optionally change port 8000 to one of your choosing (for example, if 8000 is used by another process).

What is port 8888 in Jupyter?

The port 8888 is used almost exclusively by Jupyter, and the fact that it's in use indicates more than anything that you have another Jupyter session already running. I'm 99% certain you can just kill the task that's using it, or you can run. jupyter notebook list. to see current notebooks.

What is Port 8889 and how to use it?

Port 8889 is used by another Jupyter session. You can just kill the task that's using it, or you can run you can also use another port instead of 8888,just replace 8888 by any other number you'd like.

How do I Kill A Jupyter Notebook process?

On windows, you can kill the Jupyter notebook process with taskkill. First display the list of processes with If we need a specific port and unlock it, then this response are the best. It is easy. Just type in the browser 'localhost:8888/tree'.


4 Answers

The port 8888 is used almost exclusively by Jupyter, and the fact that it's in use indicates more than anything that you have another Jupyter session already running. I'm 99% certain you can just kill the task that's using it, or you can run

jupyter notebook list

to see current notebooks. And as mentioned in the other answer you can run

jupyter notebook --port 8889

To run on a different port instead (replace 8889 by any other number you'd like).

like image 102
Hans Musgrave Avatar answered Oct 19 '22 16:10

Hans Musgrave


You could use --port argument to instruct jupyter to start the notebook server on another port.

Use jupyter notebook --help command to view the complete list of options.

like image 21
Subhendu Ranjan Mishra Avatar answered Oct 19 '22 16:10

Subhendu Ranjan Mishra


On windows, you can kill the Jupyter notebook process with taskkill. First display the list of processes with

tasklist                                   

Then kill the process with:

taskkill /F /PID  __process_id_number__

Then restart the notebook with:

jupyter notebook
like image 35
Paul Rougieux Avatar answered Oct 19 '22 15:10

Paul Rougieux


It is easy. Just type in the browser 'localhost:8888/tree'. You will get ur notebooks

like image 1
PCM Avatar answered Oct 19 '22 14:10

PCM