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

Error starting Python3 kernel inside Jupyter Notebook #4450

Closed
TCodina opened this issue Mar 5, 2019 · 12 comments
Closed

Error starting Python3 kernel inside Jupyter Notebook #4450

TCodina opened this issue Mar 5, 2019 · 12 comments

Comments

@TCodina
Copy link

TCodina commented Mar 5, 2019

Hello there. I'm having a problem with jupyter notebook kernels. Anytime I want to open a python3 kernel I get the following message:

[I 11:49:36.965 NotebookApp] Serving notebooks from local directory: /home/tomaco
[I 11:49:36.965 NotebookApp] The Jupyter Notebook is running at:
[I 11:49:36.965 NotebookApp] http://localhost:8888/?token=f99d04dcf326fd3384ca71c2ccf3d276f7611e6781606ce3
[I 11:49:36.965 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 11:49:37.041 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=f99d04dcf326fd3384ca71c2ccf3d276f7611e6781606ce3

[I 11:49:37.254 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1
[I 11:49:44.486 NotebookApp] Creating new notebook in
[E 11:49:44.941 NotebookApp] Uncaught exception GET /notebooks/Untitled14.ipynb?kernel_name=python3 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled14.ipynb?kernel_name=python3', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/web.py", line 1697, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/tornado/web.py", line 3174, in wrapper
return method(self, args, **kwargs)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 59, in get
get_custom_frontend_exporters=get_custom_frontend_exporters
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/base/handlers.py", line 467, in render_template
return template.render(**ns)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, args, **kwargs)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/templates/notebook.html", line 120, in block "header"
{% for exporter in get_custom_frontend_exporters() %}
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/notebook/notebook/handlers.py", line 19, in get_custom_frontend_exporters
from nbconvert.exporters.base import get_export_names, get_exporter
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/init.py", line 7, in
from . import postprocessors
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/init.py", line 5, in
from .serve import ServePostProcessor
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/serve.py", line 19, in
class ProxyHandler(web.RequestHandler):
File "/home/tomaco/miniconda3/lib/python3.7/site-packages/nbconvert/postprocessors/serve.py", line 21, in ProxyHandler
@web.asynchronous
AttributeError: module 'tornado.web' has no attribute 'asynchronous'
[E 11:49:44.955 NotebookApp] {
"Host": "localhost:8888",
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8",
"Accept-Language": "en-US,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"Referer": "http://localhost:8888/tree",
"Connection": "keep-alive",
"Cookie": "username-localhost-8888="2|1:0|10:1551797377|23:username-localhost-8888|44:ZDc5OWU4NDFhNmI0NDVjNWE3YjkzMzk0NDRmMTkzMzY=|851786911a4f63b45f1e09e1557a89d9a472955a440c8e9e1bee36541bca676d"; _xsrf=2|137a4b91|1c0aaae8808bc56ccf4a1c8baa098486|1550987614; username-localhost-8889="2|1:0|10:1551795072|23:username-localhost-8889|44:OTBiNTIzNDE0NWRiNDU3MWFkMWVkNDIwZjUxMmU2NzY=|c6be722c2cb2458ea4d172e681d21f7e7465bc0c58f2176da5bd4b47fb03dcab"; username-localhost-8891="2|1:0|10:1551797013|23:username-localhost-8891|44:MmNmMWFkNGU0ZTZiNGIyZTg5ZWMyMzFjY2RlOTIyMGQ=|233aad6377b67251082c48e2552b8ad291287ba0d14867861b23ac6413d88830"; username-localhost-8892="2|1:0|10:1551797270|23:username-localhost-8892|44:M2I0ZTczMWZhM2FmNDExMmEyNDFhMWU1YWVkODdiNzM=|6329346a8532f60ca039bdccb5d41052c6e0906e10200648ee2b791c834a1e2b"",
"Upgrade-Insecure-Requests": "1"
}
[E 11:49:44.955 NotebookApp] 500 GET /notebooks/Untitled14.ipynb?kernel_name=python3 (127.0.0.1) 179.55ms referer=http://localhost:8888/tree

I have installed jupyter notebook with miniconda3 just today. Any ideas?

@goranmoomin
Copy link

As a workaround:

$ pip uninstall tornado; pip install tornado==5.1.1

It should work now.

@TCodina
Copy link
Author

TCodina commented Mar 6, 2019

Thank you so much that work perfectly! Di you know why the tornado 6 version doesn't work?

@jasongrout
Copy link
Member

My guess is this is the incompatibility with tornado 6 a lot of people have been experiencing. See #4439 and #4449. The solution would be either upgrading notebook to version 5.7.5, or downgrading tornado to version 5.1.1.

@Priyankk18k
Copy link

As a workaround:

$ pip uninstall tornado; pip install tornado==5.1.1
This worked for me.

THANKS to pcr910303 . You saved me Today.

@bturimov
Copy link

I always have the following problem when I run python code through jupyter notebook.


ModuleNotFoundError Traceback (most recent call last)
in
1 #!/usr/bin/env python3
----> 2 import numpy as np
3 import matplotlib.pyplot as plt
4 import matplotlib.ticker as mtick
5 from math import sqrt

ModuleNotFoundError: No module named 'numpy'

How can solve it?

@Priyankk18k
Copy link

Priyankk18k commented Dec 17, 2019

If you are using python3 you can use pip command to install numpy.
Pip3 install numpy
If python2
Pip install numpy
Hope this helps.

@bturimov
Copy link

it did not help

@Priyankk18k
Copy link

Same error is coming ? Or something else ?

@bturimov
Copy link

same problem

@goranmoomin
Copy link

@bturimov That module error is unrelated to this issue (which is fixed), so I suggest you ask somewhere else. (hint: Google it!)

FYI it's mostly likely that you're not installing numpy to the python the jupyter is finding.
Maybe you're pip isn't pointing to the right version (pyenv might be the problem) or you didn't use pip but a custom tool like pipx when installing jupyter?

@bturimov
Copy link

Actually I have follow some youtube video to install jupyter notebook and it was working pretty well but after some times it did not work.

@goranmoomin
Copy link

@bturimov If you think the experience you’re getting is a jupyter-notebook bug, open a new bug report.

Sent with GitHawk

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

No branches or pull requests

5 participants