-
Notifications
You must be signed in to change notification settings - Fork 9
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
Export works with Jupyter Notebook but not JupyterLab #81
Comments
In case anyone else finds there way here, it could be worth confirming that the notebook metadata contains the following fields under "metadata": {
"language_info": {
"file_extension": ".py",
"nbconvert_exporter": "python"
} I found ensuring these elements were in the metadata helped nbautoexport to work as I expected - one of my environments wasn't creating these automatically. |
@mjschlauch FYI I added some takeaways from a debug session to the issue description. The culprit was a new release of |
@klwetstone's additional notes helped point me in a direction of research on the very confusing Jupyter ecosystem. I will try to summarize some key ideas here: There are actually effectively three UI applications in the Jupyter ecosystem that let people run and interact with "Jupyter notebooks" (i.e.,
One reason this is confusing is because there's been big decisions about the technology stack behind Jupyter applications that have been made over the years, that ended up getting reversed. The key ideas that I understand are:
It sounds like all three of these are expected to be normal entrypoints to Jupyter notebooks going forward, which means we should make an effort to explicitly support all of them. With that in mind, it seems like here is why stuff hasn't been working. Our code is written in a way (write to According to the Some additional complication though is that nbclassic has the functionality that it works with both It looks like eventually even Jupyter Notebook v7 will migrate to Here's a StackOverflow post that also covers some of the mechanics about the different backend servers. AnywaysSo I think the fix is definitely to start writing the nbautoexport code to There's a question about how we want to support current and older versions of Jupyter Notebook, which still only read
|
Fascinating read. Personally, I'd vote for 1, since I use classic notebooks pretty often. May be worth it to switch this line to an
|
Looks like the PR to fix the |
Description
I newly installed and configured nbautoexport. New/modified jupyter notebooks in the configured directory are not getting exported as scripts on save when using Jupyter Lab.
What I Did
I opened the same notebooks using Jupyter Notebook and they are exported as scripts on save. Interestingly, when I then go back to using Jupyter Lab, things are working as they should (new/modified notebooks are exported on save).
Interim workaround
As of now,
nbautoexport
does not work withjupyterlab
when the version ofnbclassic
is 4.0 or greater. To get both jupyterlab and jupyter notebook to work, runpip install nbclassic=0.3.7
(earlier 0.3 versions also work)Long term fix
Write out to
~/.jupyter/jupyter_server_config.py
in addition to~/.jupyter/jupyter_notebook_config.py
. After runningcp ~/.jupyter/jupyter_notebook_config.py ~/.jupyter/jupyter_server_config.py
, both jupyter lab and jupyter notebook export scripts correctly regardless of the version ofnbclassic
nbclassic
: linkThe text was updated successfully, but these errors were encountered: