-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ucmerced] Issues with voila in 2i2c-hubs-image with Jijnja2 >= 3.1.x #2360
Comments
Jinja2 is 3.1.2 in image this issue looks related d2l-ai/d2l-book#46 quay.io/2i2c/2i2c-hubs-image:05c6a27dc942 docker pulled that image and ran [W 2023-03-15 19:05:50.405 SingleUserLabApp manager:332] voila.server_extension | error adding extension (enabled: True): The module 'voila.server_extension' could not be found (cannot import name 'contextfilter' from 'jinja2' (/opt/conda/lib/python3.7/site-packages/jinja2/__init__.py)). Are you sure the extension is installed?
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/jupyter_server/extension/manager.py", line 175, in _validate_name
self._module, self._metadata = get_metadata(name)
File "/opt/conda/lib/python3.7/site-packages/jupyter_server/extension/utils.py", line 60, in get_metadata
module = importlib.import_module(package_name)
File "/opt/conda/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/conda/lib/python3.7/site-packages/voila/__init__.py", line 11, in <module>
from .server_extension import _load_jupyter_server_extension # noqa
File "/opt/conda/lib/python3.7/site-packages/voila/server_extension.py", line 19, in <module>
from .handler import VoilaHandler
File "/opt/conda/lib/python3.7/site-packages/voila/handler.py", line 29, in <module>
from .exporter import VoilaExporter
File "/opt/conda/lib/python3.7/site-packages/voila/exporter.py", line 15, in <module>
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/opt/conda/lib/python3.7/site-packages/jinja2/__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/lib/python3.7/site-packages/jupyter_server/extension/manager.py", line 320, in add_extension
extpkg = ExtensionPackage(name=extension_name, enabled=enabled)
File "/opt/conda/lib/python3.7/site-packages/jupyter_server/extension/manager.py", line 166, in __init__
super().__init__(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py", line 1361, in __init__
value = self._traits[key]._cross_validate(self, getattr(self, key))
File "/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py", line 746, in _cross_validate
value = obj._trait_validators[self.name](obj, proposal)
File "/opt/conda/lib/python3.7/site-packages/traitlets/traitlets.py", line 1233, in __call__
return self.func(*args, **kwargs)
File "/opt/conda/lib/python3.7/site-packages/jupyter_server/extension/manager.py", line 179, in _validate_name
"sure the extension is installed?".format(name=name, e=e)
jupyter_server.extension.utils.ExtensionModuleNotFound: The module 'voila.server_extension' could not be found (cannot import name 'contextfilter' from 'jinja2' (/opt/conda/lib/python3.7/site-packages/jinja2/__init__.py)). Are you sure the extension is installed?
[I 2023-03-15 19:05:50.405 SingleUserLabApp manager:344] notebook_shim | extension was successfully linked.
JUPYTERHUB_API_TOKEN env is required to run jupyterhub-singleuser. Did you launch it manually?
|
I can confirm running |
I was unable to replicated the PDF issue via |
Nice work!!! I wouldn't be surprised of voila has a fix for this, but hasnt fixed it in a version still supporting py3.7. Seeing this image at python 3.7, that many packages no longer support, makes me think we must do or absolute best to avoid it for new hubs - this is the beginning of issues like this, not the end.
|
Fix in 2i2c-org/2i2c-hubs-image#8 |
Context
print("Hello, World!)
in cell and runResult: 404 when rendering with voila - For the Voila error Dev Tools gives a 404 for below url:
https://ucmerced.2i2c.cloud/user/pnasrat@2i2c.org/voila/render/Untitled1.ipynb
Voila tracebacks: https://cloudlogging.app.goo.gl/2HzJPBaNbijC4qAd7
"[W 2023-03-15 18:32:35.052 SingleUserLabApp manager:332] voila.server_extension | error adding extension (enabled: True): The module 'voila.server_extension' could not be found (cannot import name 'contextfilter' from 'jinja2' (/opt/conda/lib/python3.7/site-packages/jinja2/__init__.py)). Are you sure the extension is installed?"
For PDF rendering
Proposal
No response
Updates and actions
No response
The text was updated successfully, but these errors were encountered: