When opening or create a new ".ipynb" file in Jupyter notebook it shows me "500: internal server error" and in terminal gives the error below. It was working fine before but when I upgraded nbconvert it started giving me this error. I upgraded nbconvert to fix the error of download jupyter notebooks as pdf file via latex or html but it didn't work after upgrading nbconvert too. Then install pandoc but still didn't work.
Tried downgrading to nbconvert to various versions given on several websites including stackoverflow.com but didn't able to fix this error.
Tried upgrading or reinstalling Jupyter again.
Tried upgrading jupyter-hub.
Tried upgrading ipython[all].
By trying all of the above solutions from various websites not able to solve this error or pass it to the new error. Still showing the same message on the web "500: internal server error" and giving the same error as shown below in the terminal.
[I 17:58:58.226 NotebookApp] Creating new notebook in /Project - House Price Prediction
[E 17:58:58.383 NotebookApp] Uncaught exception GET /notebooks/Project%20-%20House%20Price%20Prediction/Untitled.ipynb?kernel_name=python3 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Project%20-%20House%20Price%20Prediction/Untitled.ipynb?kernel_name=python3', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/tornado/web.py", line 1713, in _execute
result = await result
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/tornado/gen.py", line 782, in run
yielded = self.gen.send(value)
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/notebook/notebook/handlers.py", line 94, in get
self.write(self.render_template('notebook.html',
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/notebook/base/handlers.py", line 511, in render_template
return template.render(**ns)
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/jinja2/environment.py", line 1291, in render
self.environment.handle_exception()
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/jinja2/environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
{% for exporter in get_frontend_exporters() %}
File "/Users/harshulnanda/tensorflow-work/env/lib/python3.10/site-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
from nbconvert.exporters.base import get_export_names, get_exporter
File "/Users/harshulnanda/.local/lib/python3.10/site-packages/nbconvert/__init__.py", line 7, in <module>
from .exporters import *
File "/Users/harshulnanda/.local/lib/python3.10/site-packages/nbconvert/exporters/__init__.py", line 1, in <module>
from .asciidoc import ASCIIDocExporter
File "/Users/harshulnanda/.local/lib/python3.10/site-packages/nbconvert/exporters/asciidoc.py", line 9, in <module>
from .templateexporter import TemplateExporter
File "/Users/harshulnanda/.local/lib/python3.10/site-packages/nbconvert/exporters/templateexporter.py", line 25, in <module>
from lxml.html.clean import clean_html
File "/Users/harshulnanda/.local/lib/python3.10/site-packages/lxml/html/__init__.py", line 53, in <module>
from .. import etree
ImportError: dlopen(/Users/harshulnanda/.local/lib/python3.10/site-packages/lxml/etree.cpython-310-darwin.so, 0x0002): tried: '/Users/harshulnanda/.local/lib/python3.10/site-packages/lxml/etree.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
[E 17:58:58.386 NotebookApp] {
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Referer": "http://localhost:8888/tree/Project%20-%20House%20Price%20Prediction",
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15"
}
[E 17:58:58.386 NotebookApp] 500 GET /notebooks/Project%20-%20House%20Price%20Prediction/Untitled.ipynb?kernel_name=python3 (::1) 92.170000ms referer=http://localhost:8888/tree/Project%20-%20House%20Price%20Prediction