Reputation: 439
I am pulling my hair out trying to get jupyter lab to run. I previously had it running great, but the machine which was running my server was reset for the first time in months, and since, I am unable to connect to lab.
Jupyter-notbook is working fine.
I have seen various suggestions online to update this and that, to execute jupyter lab build
but nothing has helped. I have even tried a fresh install of miniconda, and creating a fresh environment.
I get this output when I try to connect:
p-tau.pauln> conda activate jup-test
(jup-test) np-tau.pauln> jupyter lab --no-browser
[I 2021-02-16 20:07:56.005 ServerApp] jupyterlab | extension was successfully linked.
[I 2021-02-16 20:07:57.561 ServerApp] nbclassic | extension was successfully linked.
[I 2021-02-16 20:07:57.967 LabApp] JupyterLab extension loaded from /home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/jupyterlab
[I 2021-02-16 20:07:57.967 LabApp] JupyterLab application directory is /home/pauln/.conda/envs/jup-test/share/jupyter/lab
[I 2021-02-16 20:07:57.975 ServerApp] jupyterlab | extension was successfully loaded.
[I 2021-02-16 20:07:57.994 ServerApp] nbclassic | extension was successfully loaded.
[I 2021-02-16 20:07:58.001 ServerApp] Serving notebooks from local directory: /home/pauln
[I 2021-02-16 20:07:58.001 ServerApp] Jupyter Server 1.3.0 is running at:
[I 2021-02-16 20:07:58.001 ServerApp] http://localhost:8888/lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142
[I 2021-02-16 20:07:58.001 ServerApp] or http://127.0.0.1:8888/lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142
[I 2021-02-16 20:07:58.001 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2021-02-16 20:07:58.029 ServerApp]
To access the server, open this file in a browser:
file:///home/pauln/.local/share/jupyter/runtime/jpserver-59618-open.html
Or copy and paste one of these URLs:
http://localhost:8888/lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142
or http://127.0.0.1:8888/lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142
[E 2021-02-16 20:09:19.126 ServerApp] Uncaught exception GET /lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142 (127.0.0.1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142', version='HTTP/1.1', remote_ip='127.0.0.1')
Traceback (most recent call last):
File "/home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/tornado/web.py", line 1702, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/tornado/web.py", line 3173, in wrapper
return method(self, *args, **kwargs)
File "/home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/tornado/web.py", line 1878, in wrapper
return method(self, *args, **kwargs)
File "/home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/jupyterlab_server/handlers.py", line 130, in get
tpl = self.render_template('index.html', page_config=page_config)
File "/home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/jupyter_server/base/handlers.py", line 441, in render_template
template = self.get_template(name)
File "/home/pauln/.conda/envs/jup-test/lib/python3.9/site-packages/jupyter_server/extension/handler.py", line 13, in get_template
return self.settings[env].get_template(name)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/environment.py", line 791, in get_template
return self._load_template(name, self.make_globals(globals))
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/environment.py", line 765, in _load_template
template = self.loader.load(self, name, globals)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/loaders.py", line 125, in load
code = environment.compile(source, name, filename)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/environment.py", line 554, in compile
self.handle_exception(exc_info, source_hint=source)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/_compat.py", line 36, in reraise
raise value.with_traceback(tb)
File "/home/pauln/.conda/envs/jup-test/share/jupyter/lab/static/index.html", line 1, in <module>
<!doctype html><html lang="en"><head><meta charset="utf-8"><title>JupyterLab</title><meta name="viewport" content="width=device-width,initial-scale=1">{# Copy so we do not modify the page_config with updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %}<script id="jupyter-config-data" type="application/json">{{ page_config_full | tojson }}</script>{% block favicon %}<link rel="icon" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon.ico" class="idle favicon"><link rel="" type="image/x-icon" href="{{ base_url | escape }}static/favicons/favicon-busy-1.ico" class="busy favicon">{% endblock %}<script defer="defer" src="{{page_config.fullStaticUrl}}/main.fe909ec527ecafbacef2.js"></script></head><body><script>/* Remove token from URL. */
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/environment.py", line 504, in _generate
return generate(source, self, name, filename, defer_init=defer_init)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/compiler.py", line 61, in generate
generator.visit(node)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/visitor.py", line 38, in visit
return f(node, *args, **kwargs)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/compiler.py", line 812, in visit_Template
self.blockvisit(node.body, frame)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/compiler.py", line 488, in blockvisit
self.visit(node, frame)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/visitor.py", line 38, in visit
return f(node, *args, **kwargs)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/compiler.py", line 1327, in visit_Output
self.visit(argument, frame)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/visitor.py", line 38, in visit
return f(node, *args, **kwargs)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/compiler.py", line 1519, in visit_Filter
self.fail('no filter named %r' % node.name, node.lineno)
File "/home/pauln/apps/clas12root_dg/rcdb/python/jinja2/compiler.py", line 423, in fail
raise TemplateAssertionError(msg, lineno, self.name, self.filename)
jinja2.exceptions.TemplateAssertionError: no filter named 'tojson'
[E 2021-02-16 20:09:19.193 ServerApp] Could not open static file ''
[E 2021-02-16 20:09:19.194 LabApp] {
"Host": "localhost:8888",
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:85.0) Gecko/20100101 Firefox/85.0",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "en-GB,en;q=0.5",
"Accept-Encoding": "gzip, deflate",
"Connection": "keep-alive",
"Cookie": "username-localhost-8886=\"2|1:0|10:1613495423|23:username-localhost-8886|44:ZDA4YWNjYTZjYmZjNDNlZmE2NWMwNjhjNmZiZmMyYWY=|593633859fef8c879edfd21824e90e762e49045fb285a2cc589361070e1b5251\"; _xsrf=2|aa593864|736009e7aec917f15c30603c50445e31|1613059937; username-localhost-8889=\"2|1:0|10:1613494322|23:username-localhost-8889|44:YWVhNDAyMjk5YjA2NDE4MmI1ZWQ5MWU4Y2EyYWVkMWI=|823f747d2a440249555f8493430f09edb5ba0c2b750cc8590cf4368b24849f6c\"; username-localhost-8888=\"2|1:0|10:1613503801|23:username-localhost-8888|44:MzZkZGYwMDQyZGMyNGVkZmJmYWYwOTBlNjMzNmU0YjI=|1b12b3777f1b0fc4d3f434f0756810bb12703245ef73f82569f3cdf62f03f555\"",
"Upgrade-Insecure-Requests": "1",
"Dnt": "1",
"Sec-Gpc": "1"
}
[E 2021-02-16 20:09:19.194 LabApp] 500 GET /lab?token=271769cf70c6bee101ab2ebee4e9ef528622afafe1706142 (127.0.0.1) 103.80ms referer=None
If anyone could point me in the right direction of what the issue might be, I would be hugely grateful!
Upvotes: 3
Views: 3410
Reputation: 439
This turned out to be a clash (which I don't fully understand) with some environmental variables I require for Cern's ROOT analysis framework, and some packages which depend on it.
Specifically it seemed to be caused by issues with PYTHON_PATH
, JUPYTER_PATH
and JUPYTER_CONFIG_DIR
.
Upvotes: 3
Reputation: 15439
JupyterLab 3.0 requires jinja2 >= 2.10. You must have installed a different version after installing JupyterLab or have broken dependencies for another reason. First, check for broken dependencies running:
python3 -m pip check
you should see:
jupyterlab 3.0.7 has requirement jinja2>=2.10, but you have jinja2 2.9.
jupyterlab-server 2.2.1 has requirement jinja2>=2.10, but you have jinja2 2.9.
If you see anything more, then you have more conflicts. Fix the issue by upgrading Jinja:
python3 -m pip install 'jinja2>=2.10'
And run pip check
again to ensure that no other dependencies got broken by the fix. You may also want to ensure that you run the latest JupyterLab with:
python3 -m pip install -U jupyterlab jupyterlab-server
Upvotes: 3