Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter Notebook won't start due to ports being already in use #3495

Closed
Dragotic opened this issue Apr 4, 2018 · 37 comments
Closed

Jupyter Notebook won't start due to ports being already in use #3495

Dragotic opened this issue Apr 4, 2018 · 37 comments

Comments

@Dragotic
Copy link

Dragotic commented Apr 4, 2018

Fresh install of anaconda 3.6 on Linux Mint. After restarting my computer I tried running a notebook server using the command

jupyter notebook

which returns the following error:

[I 16:33:05.169 NotebookApp] The port 8888 is already in use, trying another port.
[I 16:33:05.169 NotebookApp] The port 8889 is already in use, trying another port.
[I 16:33:05.169 NotebookApp] The port 8890 is already in use, trying another port.
[I 16:33:05.170 NotebookApp] The port 8891 is already in use, trying another port.
[I 16:33:05.170 NotebookApp] The port 8892 is already in use, trying another port.
[I 16:33:05.170 NotebookApp] The port 8788 is already in use, trying another port.
[I 16:33:05.170 NotebookApp] The port 8885 is already in use, trying another port.
[I 16:33:05.171 NotebookApp] The port 8896 is already in use, trying another port.
[I 16:33:05.171 NotebookApp] The port 8792 is already in use, trying another port.
[I 16:33:05.171 NotebookApp] The port 8987 is already in use, trying another port.
[I 16:33:05.171 NotebookApp] The port 8983 is already in use, trying another port.
[I 16:33:05.171 NotebookApp] The port 8814 is already in use, trying another port.
[I 16:33:05.172 NotebookApp] The port 8823 is already in use, trying another port.
[I 16:33:05.172 NotebookApp] The port 8923 is already in use, trying another port.
[I 16:33:05.172 NotebookApp] The port 8797 is already in use, trying another port.
[I 16:33:05.172 NotebookApp] The port 8800 is already in use, trying another port.
[I 16:33:05.173 NotebookApp] The port 8863 is already in use, trying another port.
[I 16:33:05.173 NotebookApp] The port 8835 is already in use, trying another port.
[I 16:33:05.173 NotebookApp] The port 8899 is already in use, trying another port.
[I 16:33:05.173 NotebookApp] The port 8883 is already in use, trying another port.
[I 16:33:05.173 NotebookApp] The port 8824 is already in use, trying another port.
[I 16:33:05.174 NotebookApp] The port 8806 is already in use, trying another port.
[I 16:33:05.174 NotebookApp] The port 8813 is already in use, trying another port.
[I 16:33:05.174 NotebookApp] The port 8980 is already in use, trying another port.
[I 16:33:05.174 NotebookApp] The port 8899 is already in use, trying another port.
[I 16:33:05.175 NotebookApp] The port 8888 is already in use, trying another port.
[I 16:33:05.175 NotebookApp] The port 8815 is already in use, trying another port.
[I 16:33:05.175 NotebookApp] The port 8926 is already in use, trying another port.
[I 16:33:05.175 NotebookApp] The port 8860 is already in use, trying another port.
[I 16:33:05.175 NotebookApp] The port 8848 is already in use, trying another port.
[I 16:33:05.176 NotebookApp] The port 8891 is already in use, trying another port.
[I 16:33:05.176 NotebookApp] The port 8910 is already in use, trying another port.
[I 16:33:05.176 NotebookApp] The port 8968 is already in use, trying another port.
[I 16:33:05.176 NotebookApp] The port 8936 is already in use, trying another port.
[I 16:33:05.177 NotebookApp] The port 8807 is already in use, trying another port.
[I 16:33:05.177 NotebookApp] The port 8860 is already in use, trying another port.
[I 16:33:05.177 NotebookApp] The port 8855 is already in use, trying another port.
[I 16:33:05.177 NotebookApp] The port 8980 is already in use, trying another port.
[I 16:33:05.177 NotebookApp] The port 8935 is already in use, trying another port.
[I 16:33:05.178 NotebookApp] The port 8920 is already in use, trying another port.
[I 16:33:05.178 NotebookApp] The port 8866 is already in use, trying another port.
[I 16:33:05.178 NotebookApp] The port 8790 is already in use, trying another port.
[I 16:33:05.178 NotebookApp] The port 8861 is already in use, trying another port.
[I 16:33:05.178 NotebookApp] The port 8960 is already in use, trying another port.
[I 16:33:05.179 NotebookApp] The port 8908 is already in use, trying another port.
[I 16:33:05.179 NotebookApp] The port 8962 is already in use, trying another port.
[I 16:33:05.179 NotebookApp] The port 8804 is already in use, trying another port.
[I 16:33:05.180 NotebookApp] The port 8974 is already in use, trying another port.
[I 16:33:05.180 NotebookApp] The port 8814 is already in use, trying another port.
[I 16:33:05.180 NotebookApp] The port 8889 is already in use, trying another port.
[I 16:33:05.180 NotebookApp] The port 8888 is already in use, trying another port.
[C 16:33:05.181 NotebookApp] ERROR: the notebook server could not be started because no available port could be found.

Is there any suggestion on how to resolve this issue?

I even tried providing a custom port with the --port flag but still the same issue.

@takluyver
Copy link
Member

That's weird. If you run ss -plnt, does it show that something else is using any of those sockets?

@Dragotic
Copy link
Author

Dragotic commented Apr 5, 2018

Here's the output.

$ ss -plnt
State      Recv-Q Send-Q                                                                          Local Address:Port                                                                                         Peer Address:Port              
LISTEN     0      128                                                                                 127.0.0.1:5556                                                                                                    *:*                   users:(("chrome",pid=3952,fd=284))
LISTEN     0      128                                                                               10.10.6.183:5556                                                                                                    *:*                   users:(("chrome",pid=3952,fd=283))
LISTEN     0      5                                                                                   127.0.1.1:53                                                                                                      *:*                  
LISTEN     0      5                                                                                   127.0.0.1:631                                                                                                     *:*                  
LISTEN     0      5                                                                                         ::1:631                                                                                                    :::*    

@takluyver
Copy link
Member

Nope, that doesn't show anything relevant. Is there anything odd about your network setup, or any security software you might have installed on it?

@Dragotic
Copy link
Author

Dragotic commented Apr 5, 2018

No, there is nothing tinkered at my system. It's almost freshed install Linux Mint 18.3.

@takluyver
Copy link
Member

I'm out of ideas, sorry 😕

@Dragotic
Copy link
Author

Dragotic commented Apr 5, 2018

Oh, that’s unfortunate. I even installed the launchpad through anaconda but when I run it, it stucks on “loading available apps” :/

@takluyver
Copy link
Member

It's possible that Anaconda launchpad (is that the same as navigator?) is doing something similar, looking for a local port to bind. I'm not familiar with that, though, so it might be something else entirely.

@nudro
Copy link

nudro commented Apr 11, 2018

Hi, my Jupyter Notebook shows it running on Port 8889 but using https://localhost:8889 and https://127.0.0.1:8889 does not connect. Both in Safari and Chrome. Oddly, it tells me port 8888 is in use. Out of curiosity I hit that port because prior to a few days ago I always successfully connected via port 8888. Jupyter greets me with the password screen, except this time, the password I generated using the hash does not get accepted, despite entering it into the .config file.

Here are the steps I've taken:

To connect I use:

$ ssh -L localhost:8888:localhost:8888 me@0.0.0.0

I then run

which jupyter 

/home/cordun/anaconda2/bin/jupyter

jupyter notebook 

[I 21:11:09.130 NotebookApp] Writing notebook server cookie secret to /run/user/1031/jupyter/notebook_cookie_secret
[I 21:11:09.366 NotebookApp] The port 8888 is already in use, trying another port.
[I 21:11:09.404 NotebookApp] JupyterLab beta preview extension loaded from /home/cordun/anaconda2/lib/python2.7/site-packages/jupyterlab
[I 21:11:09.404 NotebookApp] JupyterLab application directory is /home/cordun/anaconda2/share/jupyter/lab
[I 21:11:09.415 NotebookApp] Serving notebooks from local directory: /home/cordun
[I 21:11:09.415 NotebookApp] 0 active kernels
[I 21:11:09.415 NotebookApp] The Jupyter Notebook is running at:
[I 21:11:09.415 NotebookApp] https://[all ip addresses on your system]:8889/
[I 21:11:09.415 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

Error message upon opening in Chrome:

 https://127.0.0.1/8889

This site can’t be reached
127.0.0.1 refused to connect.
Try:

Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_REFUSED

But at
https://127.0.0.1:8888

It does connect and prompts me for a password. I already set my sha1 password but it will not accept it. Despite updating the config file, below, with a new password, it still will not connect.

screen shot 2018-04-10 at 9 28 31 pm

My .config:

c = get_config()
c.NotebookApp.certfile = u'/home/cordun/ssl/cert.pem'
c.NotebookApp.keyfile = u'/home/cordun/ssl/cert.key'
c.IPKernelApp.pylab = 'inline'
c.NotebookApp.ip = '*'

c.NotebookApp.open_browser = False
c.NotebookApp.password = 'sha1:xxxxxxxxxxxxxxx'

running:

 ss -plnt

returns the following:

State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 :22 :
LISTEN 0 100 127.0.0.1:56759 :
LISTEN 0 100 127.0.0.1:46327 :
LISTEN 0 5 127.0.0.1:631 :
LISTEN 0 128 :8888 :
LISTEN 0 128 127.0.0.1:6969 :
LISTEN 0 100 127.0.0.1:32794 :
LISTEN 0 100 127.0.0.1:45083 :
LISTEN 0 100 127.0.0.1:56251 :
LISTEN 0 100 127.0.0.1:53563 :
LISTEN 0 100 127.0.0.1:46332 :
LISTEN 0 100 127.0.0.1:59581 :
LISTEN 0 100 127.0.0.1:40605 :
LISTEN 71 100 127.0.0.1:51710 :
LISTEN 0 100 127.0.0.1:59070 :
LISTEN 0 100 127.0.0.1:35554 :
LISTEN 0 100 127.0.0.1:39875 :
LISTEN 0 100 127.0.0.1:32771 :
LISTEN 0 100 127.0.0.1:43876 :
LISTEN 0 100 127.0.0.1:42372 :
LISTEN 0 100 127.0.0.1:36070 :
LISTEN 0 100 127.0.0.1:43655 :
LISTEN 0 100 127.0.0.1:43944 :
LISTEN 0 100 127.0.0.1:47208 :
LISTEN 0 100 127.0.0.1:48393 :
LISTEN 0 100 127.0.0.1:49290 :
LISTEN 0 100 127.0.0.1:41995 :
LISTEN 0 100 127.0.0.1:58827 :
LISTEN 0 100 127.0.0.1:45643 :
LISTEN 0 100 127.0.0.1:34827 :
LISTEN 0 100 127.0.0.1:55147 :
LISTEN 0 100 127.0.0.1:39404 :
LISTEN 0 100 127.0.0.1:33356 :
LISTEN 0 100 127.0.0.1:54700 :
LISTEN 0 100 127.0.0.1:44589 :
LISTEN 0 100 127.0.0.1:50285 :
LISTEN 0 100 127.0.0.1:39982 :
LISTEN 0 100 127.0.0.1:41551 :
LISTEN 0 100 127.0.0.1:35055 :
LISTEN 0 100 127.0.0.1:45519 :
LISTEN 0 100 127.0.0.1:48336 :
LISTEN 0 100 127.0.0.1:38032 :
LISTEN 0 100 127.0.0.1:53585 :
LISTEN 0 100 127.0.0.1:45105 :
LISTEN 0 100 127.0.0.1:39218 :
LISTEN 0 128 :7890 :
LISTEN 0 100 127.0.0.1:43477 :
LISTEN 0 5 127.0.1.1:53 :
LISTEN 0 128 :::22 :::

LISTEN 0 5 ::1:631 :::

LISTEN 0 128 :::8888 :::

LISTEN 0 128 :::5000

Opening up notebook_cookie_secret under /run/user/1031/jupyter shows several lines of strings. Should I modify or delete this?

Should I uncomment a specific setting in the .config file?

History: Everything ran smoothly until a few days ago when I pip install anaconda-navigator. At that point, Jupyter Notebook would not accept my existing password. I ended up reinstalling Anaconda this morning. I updated anaconda this evening.

Thank you for any guidance on how to solve this issue. Currently I'm unable to open any Jupyter Notebook.

@takluyver
Copy link
Member

  • You may have two different notebook servers running, one on port 8888 and one on port 8889. If the first one was started before you set the password, it won't accept the new password.
  • If you're using an SSH tunnel, the port it points to on the remote machine needs to match the port the notebook is running on.
  • You might have used https://127.0.0.1/8889 (unless that was a typo just when you posted here). The port number needs to be separated with a colon, not a slash.

@nudro
Copy link

nudro commented Apr 11, 2018

Thank you @takluyver - Jupyter opened and now works on port 8889. What I seemed to have been doing wrong was the incorrect SSH tunnel/forwarding syntax.

ssh -L localhost:8889:localhost:8889 cordun@0.0.0.0

Was the right way. Then I called the port directly:

jupyter notebook --no-browser --port=8889

Thank you for your guidance. And yes, my mistake - it was a typo. I was using ':' not '/'. But thanks for pointing that out.

Another question I have is how can I "kill" the other notebook running on port 8888? I had looked up commands on how to see what's running on other ports via the lsof command. But unfortunately I don't have admin rights to use sudo to install lsof. While that would just confirm another notebook might be running on port 8888; do you know a way I could look it up without using lsof and then shut it down?

By the way, the notebook at port 8889 successfully accepted my new password.

Thanks again.

@takluyver
Copy link
Member

On the system that it's running on, jupyter notebook stop 8888 should work.

@UtsavChaurasia
Copy link

After launching the jupyter notebook for the first time, I am continuously facing problem in launching it. Everytime I run it through my conda navigator it gives this error:

[I 11:54:52.606 NotebookApp] The port 8888 is already in use, trying another port.
[I 11:54:52.608 NotebookApp] The port 8889 is already in use, trying another port.
[I 11:54:52.613 NotebookApp] The port 8890 is already in use, trying another port.
[I 11:54:52.615 NotebookApp] The port 8891 is already in use, trying another port.
[I 11:54:52.626 NotebookApp] The port 8892 is already in use, trying another port.
[I 11:54:52.772 NotebookApp] JupyterLab beta preview extension loaded from C:\Users\Utsav\Anaconda3\lib\site-packages\jupyterlab
[I 11:54:52.772 NotebookApp] JupyterLab application directory is C:\Users\Utsav\Anaconda3\share\jupyter\lab
[I 11:54:53.176 NotebookApp] Serving notebooks from local directory: C:\Users\Utsav
[I 11:54:53.176 NotebookApp] 0 active kernels
[I 11:54:53.176 NotebookApp] The Jupyter Notebook is running at:
[I 11:54:53.176 NotebookApp] http://localhost:8805/
[I 11:54:53.177 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 11:54:54.521 NotebookApp] 302 GET /tree (::1) 1.00ms
[E 11:54:54.533 NotebookApp] Uncaught exception GET /login?next=%2Ftree (::1)
HTTPServerRequest(protocol='http', host='localhost:8805', method='GET', uri='/login?next=%2Ftree', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\Utsav\Anaconda3\lib\site-packages\tornado\web.py", line 1541, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\auth\login.py", line 65, in get
self._render()
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\auth\login.py", line 30, in _render
message=message,
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 423, in render_template
template = self.get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 419, in get_template
return self.settings['jinja2_env'].get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 175, in get_source
contents = f.read().decode(self.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd9 in position 220806: invalid continuation byte
[E 11:54:54.540 NotebookApp] Uncaught exception in write_error
Traceback (most recent call last):
File "C:\Users\Utsav\Anaconda3\lib\site-packages\tornado\web.py", line 1541, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\auth\login.py", line 65, in get
self._render()
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\auth\login.py", line 30, in _render
message=message,
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 423, in render_template
template = self.get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 419, in get_template
return self.settings['jinja2_env'].get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 175, in get_source
contents = f.read().decode(self.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd9 in position 220806: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 493, in write_error
html = self.render_template('%s.html' % status_code, **ns)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 423, in render_template
template = self.get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 419, in get_template
return self.settings['jinja2_env'].get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 187, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: 500.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Utsav\Anaconda3\lib\site-packages\tornado\web.py", line 1063, in send_error
self.write_error(status_code, **kwargs)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 495, in write_error
html = self.render_template('error.html', **ns)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 423, in render_template
template = self.get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 419, in get_template
return self.settings['jinja2_env'].get_template(name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 830, in get_template
return self._load_template(name, self.make_globals(globals))
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\environment.py", line 804, in _load_template
template = self.loader.load(self, name, globals)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 113, in load
source, filename, uptodate = self.get_source(environment, name)
File "C:\Users\Utsav\Anaconda3\lib\site-packages\jinja2\loaders.py", line 175, in get_source
contents = f.read().decode(self.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 217406-217407: invalid continuation byte
[E 11:54:54.542 NotebookApp] {
"Host": "localhost:8805",
"Connection": "keep-alive",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9",
"Cookie": "_xsrf=2|f27e928d|41e1051c3e0b3898d65cc7fcfd4f4996|1528612924; username-localhost-8865="2|1:0|10:1529061512|23:username-localhost-8865|44:ZmJjYzlkOWI5ODc2NDZmZTk2ODkyMTQzYmM4MTgwYzA=|98730cedd0476ae6912972eada4b73922e9c9b6d5a1e41013f9df60c0275dfe2"; username-localhost-8888="2|1:0|10:1529134431|23:username-localhost-8888|44:M2U5MTAzYzNmNWQ4NGQwYmE0OWVjN2IxYmM0YzU5YWY=|01ed20926dacaa20d7d5771626a324eef114c89c29dc2a97023893d9d44c2357""
}
[E 11:54:54.543 NotebookApp] 500 GET /login?next=%2Ftree (::1) 13.00ms referer=None

@romabiker
Copy link

I faced exact the same problem. Using --ip=0.0.0.0 solved it:

jupyter notebook --ip=0.0.0.0 --port=8888

@nirajdevpandey
Copy link

I had similar issues. This might occur when you have installed some other conflicting program into your system. Such as, I installed PyLucene where many programs were installed in order to get it done. This is how I solved my problem.

First check your pip version

  1. python3 -m pip --version
    this should be greater than 0.9 or the latest would be best. The install this
  2. python3 -m pip install ipykernel
  3. python3 -m ipykernel install --user

screenshot from 2019-01-07 14-33-33
you are good to start your notebook again.

@pcnfernando
Copy link

I had the same issue and was able to resolve it with --ip=0.0.0.0.

@ZacksAmber
Copy link

On the system that it's running on, jupyter notebook stop 8888 should work.

Thank you. It works!

@hoermannpaul
Copy link

i had the same problem and for me it was my messed up /ets/hosts file. ive had 127.0.0.1 localhost and 0.0.0.0 localhost inside it, if providing something with --ip=x.x.x.x fixes the problem, also pay attention to /etc/hosts file.

@kevin-bates
Copy link
Member

I'm going to close this issue based on the recent history of helpful responses and successes. Thank you to everyone.

@Vijayalakshmi30
Copy link

I'm having issue while launching jupyter notebook from anaconda navigator.
[W 23:14:53.968 NotebookApp] Permission to listen on port 8888 denied.
[W 23:14:53.969 NotebookApp] Permission to listen on port 8889 denied.
[W 23:14:53.970 NotebookApp] Permission to listen on port 8890 denied.
[W 23:14:53.971 NotebookApp] Permission to listen on port 8891 denied.
[W 23:14:53.972 NotebookApp] Permission to listen on port 8892 denied.
[W 23:14:53.972 NotebookApp] Permission to listen on port 8977 denied.
[W 23:14:53.973 NotebookApp] Permission to listen on port 8943 denied.
[W 23:14:53.974 NotebookApp] Permission to listen on port 8988 denied.
[W 23:14:53.975 NotebookApp] Permission to listen on port 8854 denied.
[W 23:14:53.975 NotebookApp] Permission to listen on port 8945 denied.
[W 23:14:53.976 NotebookApp] Permission to listen on port 8985 denied.
[W 23:14:53.976 NotebookApp] Permission to listen on port 8839 denied.
[W 23:14:53.977 NotebookApp] Permission to listen on port 8896 denied.
[W 23:14:53.978 NotebookApp] Permission to listen on port 8938 denied.
[W 23:14:53.978 NotebookApp] Permission to listen on port 8935 denied.
[W 23:14:53.979 NotebookApp] Permission to listen on port 8954 denied.
[W 23:14:53.979 NotebookApp] Permission to listen on port 8986 denied.
[W 23:14:53.980 NotebookApp] Permission to listen on port 8944 denied.
[W 23:14:53.980 NotebookApp] Permission to listen on port 8811 denied.
[W 23:14:53.981 NotebookApp] Permission to listen on port 8909 denied.
[W 23:14:53.981 NotebookApp] Permission to listen on port 8823 denied.
[W 23:14:53.982 NotebookApp] Permission to listen on port 8854 denied.
[W 23:14:53.982 NotebookApp] Permission to listen on port 8848 denied.
[W 23:14:53.983 NotebookApp] Permission to listen on port 8923 denied.
[W 23:14:53.984 NotebookApp] Permission to listen on port 8919 denied.
[W 23:14:53.985 NotebookApp] Permission to listen on port 8815 denied.
[W 23:14:53.985 NotebookApp] Permission to listen on port 8871 denied.
[W 23:14:53.986 NotebookApp] Permission to listen on port 8951 denied.
[W 23:14:53.987 NotebookApp] Permission to listen on port 8963 denied.
[W 23:14:53.987 NotebookApp] Permission to listen on port 8888 denied.
[W 23:14:53.988 NotebookApp] Permission to listen on port 8878 denied.
[W 23:14:53.989 NotebookApp] Permission to listen on port 8963 denied.
[W 23:14:53.989 NotebookApp] Permission to listen on port 8859 denied.
[W 23:14:53.990 NotebookApp] Permission to listen on port 8828 denied.
[W 23:14:53.991 NotebookApp] Permission to listen on port 8901 denied.
[W 23:14:53.991 NotebookApp] Permission to listen on port 8899 denied.
[W 23:14:53.992 NotebookApp] Permission to listen on port 8937 denied.
[W 23:14:53.993 NotebookApp] Permission to listen on port 8832 denied.
[W 23:14:53.993 NotebookApp] Permission to listen on port 8926 denied.
[W 23:14:53.994 NotebookApp] Permission to listen on port 8916 denied.
[W 23:14:53.994 NotebookApp] Permission to listen on port 8819 denied.
[W 23:14:53.995 NotebookApp] Permission to listen on port 8852 denied.
[W 23:14:53.995 NotebookApp] Permission to listen on port 8916 denied.
[W 23:14:53.996 NotebookApp] Permission to listen on port 8978 denied.
[W 23:14:53.996 NotebookApp] Permission to listen on port 8929 denied.
[W 23:14:53.997 NotebookApp] Permission to listen on port 8918 denied.
[W 23:14:53.998 NotebookApp] Permission to listen on port 8801 denied.
[W 23:14:53.998 NotebookApp] Permission to listen on port 8854 denied.
[W 23:14:53.999 NotebookApp] Permission to listen on port 8944 denied.
[W 23:14:53.999 NotebookApp] Permission to listen on port 8816 denied.
[W 23:14:54.000 NotebookApp] Permission to listen on port 8816 denied.
[C 23:14:54.000 NotebookApp] ERROR: the notebook server could not be started because no available port could be found.
What shall I do to resolve this?

@M-Sangeetha-code
Copy link

I'm having the issuse of launching jupyter notebook from anaconda navigator it shows produced error
[W 22:35:54.188 NotebookApp] Permission to listen on port 8888 denied.
[W 22:35:54.189 NotebookApp] Permission to listen on port 8889 denied.
[W 22:35:54.189 NotebookApp] Permission to listen on port 8890 denied.
[W 22:35:54.190 NotebookApp] Permission to listen on port 8891 denied.
[W 22:35:54.190 NotebookApp] Permission to listen on port 8892 denied.
[W 22:35:54.190 NotebookApp] Permission to listen on port 8868 denied.
[W 22:35:54.191 NotebookApp] Permission to listen on port 8887 denied.
[W 22:35:54.191 NotebookApp] Permission to listen on port 8926 denied.
[W 22:35:54.192 NotebookApp] Permission to listen on port 8856 denied.
[W 22:35:54.195 NotebookApp] Permission to listen on port 8847 denied.
[W 22:35:54.195 NotebookApp] Permission to listen on port 8834 denied.
[W 22:35:54.196 NotebookApp] Permission to listen on port 8983 denied.
[W 22:35:54.196 NotebookApp] Permission to listen on port 8924 denied.
[W 22:35:54.196 NotebookApp] Permission to listen on port 8891 denied.
[W 22:35:54.197 NotebookApp] Permission to listen on port 8959 denied.
[W 22:35:54.197 NotebookApp] Permission to listen on port 8951 denied.
[W 22:35:54.198 NotebookApp] Permission to listen on port 8888 denied.
[W 22:35:54.198 NotebookApp] Permission to listen on port 8936 denied.
[W 22:35:54.199 NotebookApp] Permission to listen on port 8897 denied.
[W 22:35:54.199 NotebookApp] Permission to listen on port 8892 denied.
[W 22:35:54.199 NotebookApp] Permission to listen on port 8838 denied.
[W 22:35:54.200 NotebookApp] Permission to listen on port 8915 denied.
[W 22:35:54.201 NotebookApp] Permission to listen on port 8901 denied.
[W 22:35:54.201 NotebookApp] Permission to listen on port 8878 denied.
[W 22:35:54.201 NotebookApp] Permission to listen on port 8789 denied.
[W 22:35:54.202 NotebookApp] Permission to listen on port 8842 denied.
[W 22:35:54.202 NotebookApp] Permission to listen on port 8803 denied.
[W 22:35:54.203 NotebookApp] Permission to listen on port 8953 denied.
[W 22:35:54.203 NotebookApp] Permission to listen on port 8892 denied.
[W 22:35:54.203 NotebookApp] Permission to listen on port 8964 denied.
[W 22:35:54.204 NotebookApp] Permission to listen on port 8988 denied.
[W 22:35:54.204 NotebookApp] Permission to listen on port 8814 denied.
[W 22:35:54.205 NotebookApp] Permission to listen on port 8915 denied.
[W 22:35:54.205 NotebookApp] Permission to listen on port 8867 denied.
[W 22:35:54.205 NotebookApp] Permission to listen on port 8801 denied.
[W 22:35:54.206 NotebookApp] Permission to listen on port 8864 denied.
[W 22:35:54.206 NotebookApp] Permission to listen on port 8954 denied.
[W 22:35:54.207 NotebookApp] Permission to listen on port 8786 denied.
[W 22:35:54.208 NotebookApp] Permission to listen on port 8961 denied.
[W 22:35:54.208 NotebookApp] Permission to listen on port 8911 denied.
[W 22:35:54.209 NotebookApp] Permission to listen on port 8905 denied.
[W 22:35:54.209 NotebookApp] Permission to listen on port 8990 denied.
[W 22:35:54.209 NotebookApp] Permission to listen on port 8904 denied.
[W 22:35:54.210 NotebookApp] Permission to listen on port 8851 denied.
[W 22:35:54.210 NotebookApp] Permission to listen on port 8876 denied.
[W 22:35:54.210 NotebookApp] Permission to listen on port 8806 denied.
[W 22:35:54.211 NotebookApp] Permission to listen on port 8848 denied.
[W 22:35:54.211 NotebookApp] Permission to listen on port 8809 denied.
[W 22:35:54.212 NotebookApp] Permission to listen on port 8947 denied.
[W 22:35:54.212 NotebookApp] Permission to listen on port 8958 denied.
[W 22:35:54.212 NotebookApp] Permission to listen on port 8860 denied.
[C 22:35:54.213 NotebookApp] ERROR: the notebook server could not be started because no available port could be found.
what is the solution for this error?

@sumanthkumarc
Copy link

sumanthkumarc commented Jun 19, 2020

i had the same problem and for me it was my messed up /ets/hosts file. ive had 127.0.0.1 localhost and 0.0.0.0 localhost inside it, if providing something with --ip=x.x.x.x fixes the problem, also pay attention to /etc/hosts file.

I had similar issues where it tried all ports and it said none of the ports are available. This worked for me 👍

@M-Sangeetha-code
Copy link

M-Sangeetha-code commented Jun 19, 2020 via email

@Dushyantsingh-ds
Copy link

Hey Github, I face the same error pls share any perfect solution for this

[W 22:50:19.358 NotebookApp] Permission to listen on port 8888 denied.
[W 22:50:19.360 NotebookApp] Permission to listen on port 8889 denied.
[W 22:50:19.361 NotebookApp] Permission to listen on port 8890 denied.
[W 22:50:19.361 NotebookApp] Permission to listen on port 8891 denied.
[W 22:50:19.362 NotebookApp] Permission to listen on port 8892 denied.
[W 22:50:19.363 NotebookApp] Permission to listen on port 8901 denied.
[W 22:50:19.364 NotebookApp] Permission to listen on port 8896 denied.
[W 22:50:19.365 NotebookApp] Permission to listen on port 8941 denied.
[W 22:50:19.367 NotebookApp] Permission to listen on port 8947 denied.
[W 22:50:19.368 NotebookApp] Permission to listen on port 8859 denied.
[W 22:50:19.369 NotebookApp] Permission to listen on port 8944 denied.
[W 22:50:19.370 NotebookApp] Permission to listen on port 8936 denied.
[W 22:50:19.372 NotebookApp] Permission to listen on port 8858 denied.
[W 22:50:19.373 NotebookApp] Permission to listen on port 8794 denied.
[W 22:50:19.374 NotebookApp] Permission to listen on port 8916 denied.
[W 22:50:19.375 NotebookApp] Permission to listen on port 8903 denied.
[W 22:50:19.376 NotebookApp] Permission to listen on port 8866 denied.
[W 22:50:19.377 NotebookApp] Permission to listen on port 8837 denied.
[W 22:50:19.378 NotebookApp] Permission to listen on port 8800 denied.
[W 22:50:19.379 NotebookApp] Permission to listen on port 8909 denied.
[W 22:50:19.380 NotebookApp] Permission to listen on port 8947 denied.
[W 22:50:19.382 NotebookApp] Permission to listen on port 8805 denied.
[W 22:50:19.383 NotebookApp] Permission to listen on port 8886 denied.
[W 22:50:19.384 NotebookApp] Permission to listen on port 8834 denied.
[W 22:50:19.385 NotebookApp] Permission to listen on port 8790 denied.
[W 22:50:19.386 NotebookApp] Permission to listen on port 8807 denied.
[W 22:50:19.387 NotebookApp] Permission to listen on port 8953 denied.
[W 22:50:19.389 NotebookApp] Permission to listen on port 8966 denied.
[W 22:50:19.390 NotebookApp] Permission to listen on port 8813 denied.
[W 22:50:19.391 NotebookApp] Permission to listen on port 8822 denied.
[W 22:50:19.392 NotebookApp] Permission to listen on port 8912 denied.
[W 22:50:19.393 NotebookApp] Permission to listen on port 8957 denied.
[W 22:50:19.394 NotebookApp] Permission to listen on port 8891 denied.
[W 22:50:19.396 NotebookApp] Permission to listen on port 8930 denied.
[W 22:50:19.397 NotebookApp] Permission to listen on port 8797 denied.
[W 22:50:19.398 NotebookApp] Permission to listen on port 8919 denied.
[W 22:50:19.399 NotebookApp] Permission to listen on port 8863 denied.
[W 22:50:19.400 NotebookApp] Permission to listen on port 8845 denied.
[W 22:50:19.402 NotebookApp] Permission to listen on port 8976 denied.
[W 22:50:19.405 NotebookApp] Permission to listen on port 8913 denied.
[W 22:50:19.407 NotebookApp] Permission to listen on port 8858 denied.
[W 22:50:19.409 NotebookApp] Permission to listen on port 8815 denied.
[W 22:50:19.411 NotebookApp] Permission to listen on port 8859 denied.
[W 22:50:19.413 NotebookApp] Permission to listen on port 8860 denied.
[W 22:50:19.416 NotebookApp] Permission to listen on port 8818 denied.
[W 22:50:19.417 NotebookApp] Permission to listen on port 8854 denied.
[W 22:50:19.420 NotebookApp] Permission to listen on port 8899 denied.
[W 22:50:19.421 NotebookApp] Permission to listen on port 8907 denied.
[W 22:50:19.422 NotebookApp] Permission to listen on port 8910 denied.
[W 22:50:19.423 NotebookApp] Permission to listen on port 8810 denied.
[W 22:50:19.424 NotebookApp] Permission to listen on port 8793 denied.
[C 22:50:19.425 NotebookApp] ERROR: the notebook server could not be started because no available port could be found.

@Ramadas-Kamat
Copy link

I had the same issue and was able to resolve it with --ip=0.0.0.0.

This worked but on another port 8890, the other ports 8888 and 8889 are still in use. Could access the notebook with the link

@reveng007
Copy link

I'm somewhat able to troubleshoot the problem...
Step1:
Actually I opened the task manager and searched for jupyter notebook in the list that was running and when I found I turned off all the jupyter notebook localhost server port that was showing status, "running".
Step2:
After that when I opened jupyter notebook, It nicely opened on the default port 8888.
But one thing to keep in mind, with this method every time you turn off /logoff jupyter notebook, you have to recap the above step 1 procedure, to run the localhost server on default port 8888.

Hope, this helps...

If somebody know any other solutions, please let me know.....

@jangsuho
Copy link

jangsuho commented Sep 3, 2020

Uh.. are you using the aws EC2 service? If so, restart the instance.

Hope, this helps...too

@XueminLiu111
Copy link

i had the same problem and for me it was my messed up /ets/hosts file. ive had 127.0.0.1 localhost and 0.0.0.0 localhost inside it, if providing something with --ip=x.x.x.x fixes the problem, also pay attention to /etc/hosts file.

Hi, can anyone tell me how to fix the problem using this method? Thanks a lot.

@BexTuychiev
Copy link

Hey Github, I face the same error pls share any perfect solution for this

[W 22:50:19.358 NotebookApp] Permission to listen on port 8888 denied.
[W 22:50:19.360 NotebookApp] Permission to listen on port 8889 denied.
[W 22:50:19.361 NotebookApp] Permission to listen on port 8890 denied.
[W 22:50:19.361 NotebookApp] Permission to listen on port 8891 denied.
[W 22:50:19.362 NotebookApp] Permission to listen on port 8892 denied.
[W 22:50:19.363 NotebookApp] Permission to listen on port 8901 denied.
[W 22:50:19.364 NotebookApp] Permission to listen on port 8896 denied.
[W 22:50:19.365 NotebookApp] Permission to listen on port 8941 denied.
[W 22:50:19.367 NotebookApp] Permission to listen on port 8947 denied.
[W 22:50:19.368 NotebookApp] Permission to listen on port 8859 denied.
[W 22:50:19.369 NotebookApp] Permission to listen on port 8944 denied.
[W 22:50:19.370 NotebookApp] Permission to listen on port 8936 denied.
[W 22:50:19.372 NotebookApp] Permission to listen on port 8858 denied.
[W 22:50:19.373 NotebookApp] Permission to listen on port 8794 denied.
[W 22:50:19.374 NotebookApp] Permission to listen on port 8916 denied.
[W 22:50:19.375 NotebookApp] Permission to listen on port 8903 denied.
[W 22:50:19.376 NotebookApp] Permission to listen on port 8866 denied.
[W 22:50:19.377 NotebookApp] Permission to listen on port 8837 denied.
[W 22:50:19.378 NotebookApp] Permission to listen on port 8800 denied.
[W 22:50:19.379 NotebookApp] Permission to listen on port 8909 denied.
[W 22:50:19.380 NotebookApp] Permission to listen on port 8947 denied.
[W 22:50:19.382 NotebookApp] Permission to listen on port 8805 denied.
[W 22:50:19.383 NotebookApp] Permission to listen on port 8886 denied.
[W 22:50:19.384 NotebookApp] Permission to listen on port 8834 denied.
[W 22:50:19.385 NotebookApp] Permission to listen on port 8790 denied.
[W 22:50:19.386 NotebookApp] Permission to listen on port 8807 denied.
[W 22:50:19.387 NotebookApp] Permission to listen on port 8953 denied.
[W 22:50:19.389 NotebookApp] Permission to listen on port 8966 denied.
[W 22:50:19.390 NotebookApp] Permission to listen on port 8813 denied.
[W 22:50:19.391 NotebookApp] Permission to listen on port 8822 denied.
[W 22:50:19.392 NotebookApp] Permission to listen on port 8912 denied.
[W 22:50:19.393 NotebookApp] Permission to listen on port 8957 denied.
[W 22:50:19.394 NotebookApp] Permission to listen on port 8891 denied.
[W 22:50:19.396 NotebookApp] Permission to listen on port 8930 denied.
[W 22:50:19.397 NotebookApp] Permission to listen on port 8797 denied.
[W 22:50:19.398 NotebookApp] Permission to listen on port 8919 denied.
[W 22:50:19.399 NotebookApp] Permission to listen on port 8863 denied.
[W 22:50:19.400 NotebookApp] Permission to listen on port 8845 denied.
[W 22:50:19.402 NotebookApp] Permission to listen on port 8976 denied.
[W 22:50:19.405 NotebookApp] Permission to listen on port 8913 denied.
[W 22:50:19.407 NotebookApp] Permission to listen on port 8858 denied.
[W 22:50:19.409 NotebookApp] Permission to listen on port 8815 denied.
[W 22:50:19.411 NotebookApp] Permission to listen on port 8859 denied.
[W 22:50:19.413 NotebookApp] Permission to listen on port 8860 denied.
[W 22:50:19.416 NotebookApp] Permission to listen on port 8818 denied.
[W 22:50:19.417 NotebookApp] Permission to listen on port 8854 denied.
[W 22:50:19.420 NotebookApp] Permission to listen on port 8899 denied.
[W 22:50:19.421 NotebookApp] Permission to listen on port 8907 denied.
[W 22:50:19.422 NotebookApp] Permission to listen on port 8910 denied.
[W 22:50:19.423 NotebookApp] Permission to listen on port 8810 denied.
[W 22:50:19.424 NotebookApp] Permission to listen on port 8793 denied.
[C 22:50:19.425 NotebookApp] ERROR: the notebook server could not be started because no available port could be found.

I was having this exact same issue. Running:

jupyter notebook --port 9999 

fixed my problem

@simonm3
Copy link

simonm3 commented May 23, 2021

Tried all of the above and still can't use jupyter any more.
The issue should definitely not be closed.

@simonm3
Copy link

simonm3 commented May 25, 2021

This cleared it for me. it is an issue with windows/hyperv

net stop winnat
net start winnat

@AkashKumarSingh11032001
Copy link

This cleared it for me. it is an issue with windows/hyperv

net stop winnat
net start winnat

Thanks, It worked for me!

@FFRfree
Copy link

FFRfree commented Jul 16, 2021

https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/default-dynamic-port-range-tcpip-chang
After setting hyperv's dynamic port range to 10000 plus and restart my computer, i resolve the problem
netsh int ipv4 set dynamicport tcp start=10000 num=1000

@Bhaskarwartushar
Copy link

Same error I was facing, One of the issues with your antivirus installed...
SO one thing you can check or allow python.exe from the firewall of antivirus... This solved my problems...
Hope it works for you also...

@Moushumi1996
Copy link

Same error I was facing, One of the issues with your antivirus installed...
SO one thing you can check or allow python.exe from the firewall of antivirus... This solved my problems...
Hope it works for you also...

It helped

@aladeen57
Copy link

This cleared it for me. it is an issue with windows/hyperv

net stop winnat
net start winnat

Thanks it worked for me too !!!!

@LVXUEYANGTiger
Copy link

这为我清除了它。这是 windows/hyperv 的问题

net stop winnat
net start winnat

谢谢它也对我有用!!!

@Meng-ShuPing
Copy link

我也碰到了这个问题,再使用jupyter notebook --ip 0.0.0.0或者实际ip时都可以正常启动, 但使用jupyter notebook --ip localhosts时,出现了同样的端口被占用问题, 查看hosts文件里后发现是我把0.0.0.0指向了localhost,去掉这个ip映射就好了

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests