Jupter notebook – 500 : Internal Server Error – Mac M1

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:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<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

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật