-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix Jupyter notebook #98
Comments
I think this may be intermittent and on myBinder. @ns-rse please will you take a look? |
Just started investigating, the log from launching is below, it builds ok and says its launching so I would hazard a guess that the problem is with Binder, particularly given Git indicates the
|
I've now experienced I tried setting up a new instance from the above link, specifying the repository, branch ( Digging into the Binder documentation I found there is an events archive which includes links to the logs of all events and code on how to download these into Python. So we can look at the logs for today ( import pandas as pd
# Set variables
date = "2022-06-13"
pgfinder_repo = "Mesnage-Org/PGFinder/master"
# Load data
binder_log = pd.read_json(f"https://archive.analytics.mybinder.org/events-{date}.jsonl", lines=True)
# Filter for this repo on the master branch
binder_log.loc[binder_log["spec"] == pgfinder_repo].T
433
timestamp 2022-06-13 01:50:00+00:00
schema binderhub.jupyter.org/launch
version 5
provider GitHub
spec Mesnage-Org/PGFinder/master
ref 5e005052c34e00de27ce16c965ea7d33f76a0399
status success
build_token True
origin gke.mybinder.org Only one instance appears to have successfully launched, which somewhat aligns with our current experience. In tweaking the date = "2022-06-09"
pgfinder_repo = "Mesnage-Org/PGFinder/master"
# Load data
binder_log_20220609 = pd.read_json(f"https://archive.analytics.mybinder.org/events-{date}.jsonl", lines=True)
# Filter for this repo on the master branch
binder_log_20220609.loc[binder_log_20220609["spec"] == pgfinder_repo].T
5497 7128
timestamp 2022-06-09 13:24:00+00:00 2022-06-09 16:06:00+00:00
schema binderhub.jupyter.org/launch binderhub.jupyter.org/launch
version 5 5
provider GitHub GitHub
spec Mesnage-Org/PGFinder/master Mesnage-Org/PGFinder/master
ref ba8e9ea52ffea835654ef439946e8d80d9259b3e b12324159e67511cd795fc635207b09a752eca05
status success success
build_token True True
origin gesis.mybinder.org gesis.mybinder.org Two successful launches of the pgfinder_repo = "Mesnage-Org/PGFinder/v0.1.0"
binder_log_20220609.loc[binder_log_20220609["spec"] == pgfinder_repo].T
5660 7087
timestamp 2022-06-09 13:41:00+00:00 2022-06-09 16:02:00+00:00
schema binderhub.jupyter.org/launch binderhub.jupyter.org/launch
version 5 5
provider GitHub GitHub
spec Mesnage-Org/PGFinder/v0.1.0 Mesnage-Org/PGFinder/v0.1.0
ref 8cffb481a88f9e4377b32514c86903af4515fbdf 8cffb481a88f9e4377b32514c86903af4515fbdf
status success success
build_token True True
origin gke.mybinder.org gke.mybinder.org Again two successful launches. At the moment I'm not sure what is going on here because on "our" side of things nothing has changed between Thursday and today
...all of which points to it being an error on the Binder side of things. I'll keep an eye on things and test them again a little later to see if it has resolved itself. |
For sanity I've checked in different browsers and it fails across the following...
There are some errors when setting up the Notebook related to Jinja2 and the hiding of code using �[91mTraceback (most recent call last):
File "/srv/conda/envs/notebook/bin/jupyter-contrib", line 8, in <module>
sys.exit(main())
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_core/application.py", line 264, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/traitlets/config/application.py", line 662, in launch_instance
app = cls.instance(**kwargs)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/traitlets/config/configurable.py", line 412, in instance
inst = cls(*args, **kwargs)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_contrib_core/application.py", line 27, in __init__
self._refresh_subcommands()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_contrib_core/application.py", line 43, in _refresh_subcommands
get_subcommands_dict = entrypoint.load()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2471, in load
return self.resolve()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2477, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_contrib_nbextensions/application.py", line 15, in <module>
from jupyter_contrib_nbextensions.install import (
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_contrib_nbextensions/install.py", line 12, in <module>
import latex_envs
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/latex_envs/__init__.py", line 3, in <module>
from . import latex_envs
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/latex_envs/latex_envs.py", line 20, in <module>
from nbconvert.exporters.exporter import Exporter
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
from .html import HTMLExporter
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 12, in <module>
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/srv/conda/envs/notebook/lib/python3.7/site-packages/jinja2/__init__.py)
�[0m�[91mCopying: hide_code -> /srv/conda/envs/notebook/share/jupyter/nbextensions/hide_code
�[0m�[91mTraceback (most recent call last):
File "/srv/conda/envs/notebook/bin/jupyter-nbextension", line 10, in <module>
sys.exit(main())
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_core/application.py", line 264, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/traitlets/config/application.py", line 664, in launch_instance
app.start()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/notebook/nbextensions.py", line 980, in start
super().start()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/jupyter_core/application.py", line 253, in start
self.subapp.start()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/notebook/nbextensions.py", line 708, in start
self.install_extensions()
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/notebook/nbextensions.py", line 687, in install_extensions
**kwargs
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/notebook/nbextensions.py", line 191, in install_nbextension
_maybe_copy(src, full_dest, logger=logger)
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/notebook/nbextensions.py", line 1038, in _maybe_copy
shutil.copy2(src, dest)
File "/srv/conda/envs/notebook/lib/python3.7/shutil.py", line 266, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/srv/conda/envs/notebook/lib/python3.7/shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: 'hide_code'
�[0m�[91mEnabling notebook extension hide_code...
�[0m�[91m - Validating: problems found:
- require? �[31m X�[0m hide_code
�[0m�[91mEnabling: hide_code
- Writing config: /srv/conda/envs/notebook/etc/jupyter
�[0m�[91m - Validating...
�[0m�[91mError loading server extension hide_code
�[31m X�[0m is hide_code importable?
�[0m�[91mTraceback (most recent call last):
File "<string>", line 1, in <module>
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/hide_code/__init__.py", line 1, in <module>
from hide_code.hide_code_html_exporter import HideCodeHTMLExporter
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/hide_code/hide_code_html_exporter.py", line 6, in <module>
from nbconvert.exporters.html import HTMLExporter
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/nbconvert/exporters/__init__.py", line 3, in <module>
from .html import HTMLExporter
File "/srv/conda/envs/notebook/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 12, in <module>
from jinja2 import contextfilter
ImportError: cannot import name 'contextfilter' from 'jinja2' (/srv/conda/envs/notebook/lib/python3.7/site-packages/jinja2/__init__.py) Might be some of these packages that have been recently updated (e.g. jupyterlab was updated 2022-06-07) so I'll check these tomorrow. |
There is something strange going on here, a search for the error In the log-files from launching the Notebook where all dependencies are installed we have the following...
Which shows that initially For our problem though the question is why
Ok so why is
We might be getting somewhere as we have a pointer to something we can control, i.e. line 2 of The latest version of
It is, so we can't do anything there as we're already using the most recent version. But if we look at the hide_code issues on GitHub we find a host of reports with similar problems...
The oldest was closed in 2020 with the "fix" being to pegging the dependency for I've added our voice to the most recent issue #101 | Support for recent nbconvert and traitlets. But then I went back to pip's error...
What is the most recent version of Having done so I've given it a whirl and tried launching the interactive notebook off of the commit 73adc7d (<< Follow this link, it should launch the notebook and work, it just has for me!). The current situation of being dependent on Binder, the configuration of which is in many places outside of our control as it appears many packages are pulled in automatically in the virtual environments they launch, is not ideal. This has taken a couple of hours of head scratching and reading logs to work out which is time I could have spent on #7 and #80 |
Published link (see below) no longer works. It says something about the package that it tries to install not being the right one.
Can't copy/paste the error message, all I get at the end is 500 : Internal Server Error
https://mybinder.org/v2/gh/Mesnage-Org/PGFinder/master?urlpath=tree/pgfinder_interactive.ipynb
The text was updated successfully, but these errors were encountered: