I am getting “500 : Internal Server Error” on my jupter when I click on ipynb or try to create a new one.
In the console I see the following:
<code>[E 22:52:50.872 NotebookApp] 500 GET /notebooks/Untitled.ipynb (::1) 73.950000ms referer=http://localhost:8888/tree
[E 22:53:32.304 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/tornado/gen.py", line 775, in run
yielded = self.gen.send(value)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/notebook/handlers.py", line 95, in get
self.write(self.render_template('notebook.html',
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/base/handlers.py", line 516, in render_template
return template.render(**ns)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
{% for exporter in get_frontend_exporters() %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/notebook/handlers.py", line 40, in get_frontend_exporters
for name in get_export_names():
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/base.py", line 146, in get_export_names
e = get_exporter(exporter_name)(config=config)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/base.py", line 102, in get_exporter
exporter = entrypoints.get_single('nbconvert.exporters', name).load()
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/entrypoints.py", line 82, in load
mod = import_module(self.module_name)
File "/Users/ali/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
from .html import HTMLExporter
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/html.py", line 14, in <module>
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/__init__.py)
</code>
<code>[E 22:52:50.872 NotebookApp] 500 GET /notebooks/Untitled.ipynb (::1) 73.950000ms referer=http://localhost:8888/tree
[E 22:53:32.304 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/tornado/gen.py", line 775, in run
yielded = self.gen.send(value)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/notebook/handlers.py", line 95, in get
self.write(self.render_template('notebook.html',
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/base/handlers.py", line 516, in render_template
return template.render(**ns)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
{% for exporter in get_frontend_exporters() %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/notebook/handlers.py", line 40, in get_frontend_exporters
for name in get_export_names():
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/base.py", line 146, in get_export_names
e = get_exporter(exporter_name)(config=config)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/base.py", line 102, in get_exporter
exporter = entrypoints.get_single('nbconvert.exporters', name).load()
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/entrypoints.py", line 82, in load
mod = import_module(self.module_name)
File "/Users/ali/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
from .html import HTMLExporter
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/html.py", line 14, in <module>
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/__init__.py)
</code>
[E 22:52:50.872 NotebookApp] 500 GET /notebooks/Untitled.ipynb (::1) 73.950000ms referer=http://localhost:8888/tree
[E 22:53:32.304 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/tornado/gen.py", line 775, in run
yielded = self.gen.send(value)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/notebook/handlers.py", line 95, in get
self.write(self.render_template('notebook.html',
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/base/handlers.py", line 516, in render_template
return template.render(**ns)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 1301, in render
self.environment.handle_exception()
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/environment.py", line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
{% for exporter in get_frontend_exporters() %}
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/notebook/notebook/handlers.py", line 40, in get_frontend_exporters
for name in get_export_names():
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/base.py", line 146, in get_export_names
e = get_exporter(exporter_name)(config=config)
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/base.py", line 102, in get_exporter
exporter = entrypoints.get_single('nbconvert.exporters', name).load()
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/entrypoints.py", line 82, in load
mod = import_module(self.module_name)
File "/Users/ali/opt/anaconda3/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
from .html import HTMLExporter
File "/Users/ali/opt/anaconda3/lib/python3.9/site-packages/nbconvert/exporters/html.py", line 14, in <module>
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/Users/ali/opt/anaconda3/lib/python3.9/site-packages/jinja2/__init__.py)
Any ideas how to fix this?
I installed this using pip
, I am running it in a venv
using python 3.12.2
Thanks