Hi. I tried running jupyter notebook recently and faced with the following issue. I run local jupyter server, try to open any notebook from filesystem and I get 500 : Internal Server Error.
Here are logs from jupyter server.
[E 22:47:46.040 NotebookApp] Uncaught exception GET /notebooks/sem_tasks/05_data_files2/TOBD_sem_05_data_files2_v2_blank.ipynb (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/sem_tasks/05_data_files2/TOBD_sem_05_data_files2_v2_blank.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/tornado/web.py", line 1704, in _execute
result = await result
File "/usr/local/lib/python3.8/dist-packages/tornado/gen.py", line 775, in run
yielded = self.gen.send(value)
File "/usr/local/lib/python3.8/dist-packages/notebook/notebook/handlers.py", line 95, in get
self.write(self.render_template('notebook.html',
File "/usr/local/lib/python3.8/dist-packages/notebook/base/handlers.py", line 516, in render_template
return template.render(**ns)
File "/home/sabyanin/.local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/home/sabyanin/.local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/home/sabyanin/.local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.8/dist-packages/notebook/templates/notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "/usr/local/lib/python3.8/dist-packages/notebook/templates/page.html", line 154, in top-level template code
{% block header %}
File "/usr/local/lib/python3.8/dist-packages/notebook/templates/notebook.html", line 115, in block "header"
{% for exporter in get_frontend_exporters() %}
File "/usr/local/lib/python3.8/dist-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
from nbconvert.exporters.base import get_export_names, get_exporter
File "/usr/local/lib/python3.8/dist-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/usr/local/lib/python3.8/dist-packages/nbconvert/exporters/__init__.py", line 4, in <module>
from .slides import SlidesExporter
File "/usr/local/lib/python3.8/dist-packages/nbconvert/exporters/slides.py", line 12, in <module>
from ..preprocessors.base import Preprocessor
File "/usr/local/lib/python3.8/dist-packages/nbconvert/preprocessors/__init__.py", line 7, in <module>
from .csshtmlheader import CSSHTMLHeaderPreprocessor
File "/usr/local/lib/python3.8/dist-packages/nbconvert/preprocessors/csshtmlheader.py", line 14, in <module>
from jupyterlab_pygments import JupyterStyle
File "/usr/local/lib/python3.8/dist-packages/jupyterlab_pygments/__init__.py", line 4, in <module>
from .style import JupyterStyle
File "/usr/local/lib/python3.8/dist-packages/jupyterlab_pygments/style.py", line 10, in <module>
class JupyterStyle(Style):
File "/usr/lib/python3/dist-packages/pygments/style.py", line 101, in __new__
ndef[0] = colorformat(styledef)
File "/usr/lib/python3/dist-packages/pygments/style.py", line 58, in colorformat
assert False, "wrong color format %r" % text
AssertionError: wrong color format 'var(--jp-mirror-editor-variable-color)'
[E 22:47:46.045 NotebookApp] {
"Host": "localhost:8888",
"Connection": "keep-alive",
"Sec-Ch-Ua": "\"Chromium\";v=\"94\", \"Google Chrome\";v=\"94\", \";Not A Brand\";v=\"99\"",
"Sec-Ch-Ua-Mobile": "?0",
"Sec-Ch-Ua-Platform": "\"Linux\"",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-User": "?1",
"Sec-Fetch-Dest": "document",
"Referer": "http://localhost:8888/tree/sem_tasks/05_data_files2",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "en-US,en;q=0.9,ru;q=0.8",
"Cookie": "_xsrf=2|471c0411|ef46fbdadc5c7e7d8a5a58823e4c6c33|1639510655; username-localhost-8888=\"2|1:0|10:1639511260|23:username-localhost-8888|44:ODhiY2Y0ZWIyYzQ4NGJjZTlmNmM3MmY5MzA4ODg2ZWQ=|d4ae11da3ee3adf2eb98e1c8e69ec53333c5aaaaf3ccd58427bd5bdcda54fbc4\""
}
[E 22:47:46.045 NotebookApp] 500 GET /notebooks/sem_tasks/05_data_files2/TOBD_sem_05_data_files2_v2_blank.ipynb (127.0.0.1) 69.940000ms referer=http://localhost:8888/tree/sem_tasks/05_data_files2
I installed jupyter with the following steps.
sudo pip3 install virtualenv
virtualenv env
source ./env/bin/activate
pip3 install jupyter
When faced issue for first time tried to google it. Found a recommendation to update pygments to >=2.4.1. Did pip3 install --upgrade pygments
. Didn't help. Also tried to update nbconvert. Didn't help as well.
Here is the list of packages in pip3:
Package Version
-------------------- ---------
alembic 1.7.5
argon2-cffi 21.3.0
argon2-cffi-bindings 21.2.0
async-generator 1.10
attrs 21.2.0
backcall 0.2.0
bleach 4.1.0
certifi 2021.10.8
certipy 0.1.3
cffi 1.15.0
charset-normalizer 2.0.9
cryptography 36.0.0
debugpy 1.5.1
decorator 5.1.0
defusedxml 0.7.1
entrypoints 0.3
greenlet 1.1.2
idna 3.3
importlib-metadata 4.8.2
importlib-resources 5.4.0
ipykernel 6.6.0
ipython 7.30.1
ipython-genutils 0.2.0
ipywidgets 7.6.5
jedi 0.18.1
Jinja2 3.0.3
jsonschema 4.2.1
jupyter 1.0.0
jupyter-client 7.1.0
jupyter-console 6.4.0
jupyter-core 4.9.1
jupyter-telemetry 0.1.0
jupyterhub 2.0.0
jupyterlab-pygments 0.1.2
jupyterlab-widgets 1.0.2
Mako 1.1.6
MarkupSafe 2.0.1
matplotlib-inline 0.1.3
mistune 0.8.4
nbclient 0.5.9
nbconvert 6.3.0
nbformat 5.1.3
nest-asyncio 1.5.4
notebook 6.4.6
oauthlib 3.1.1
packaging 21.3
pamela 1.0.0
pandocfilters 1.5.0
parso 0.8.3
pexpect 4.8.0
pickleshare 0.7.5
pip 21.3.1
prometheus-client 0.12.0
prompt-toolkit 3.0.24
ptyprocess 0.7.0
pycparser 2.21
Pygments 2.10.0
pyOpenSSL 21.0.0
pyparsing 3.0.6
pyrsistent 0.18.0
python-dateutil 2.8.2
python-json-logger 2.0.2
pyzmq 22.3.0
qtconsole 5.2.2
QtPy 1.11.3
requests 2.26.0
ruamel.yaml 0.17.17
ruamel.yaml.clib 0.2.6
Send2Trash 1.8.0
setuptools 58.3.0
six 1.16.0
SQLAlchemy 1.4.28
terminado 0.12.1
testpath 0.5.0
tornado 6.1
traitlets 5.1.1
urllib3 1.26.7
wcwidth 0.2.5
webencodings 0.5.1
wheel 0.37.0
widgetsnbextension 3.5.2
zipp 3.6.0