After a recent package update on Python 3.9 the toc2 extension in jupyter notebook stopped working reliably. When a notebook is opened, the TOC floating window appears, however, the TOC window:
Can only be moved (dragged) once after the notebook is loaded: after the initial move, the window cannot be moved anymore
Cannot be resized by dragging the corner (but can via editing the cell metadata and reloading the notebook)
Cannot be folded (or, if configured to start as folded, cannot be unfolded (expanded))
The sections in the TOC2 can be folded/unfolded as usual, and can be used to navigate the notebook.
Please let me know what additional info I should provide for troubleshooting.
Thank you,
Alex
UPDATE: Tried to use toc2 in a fresh install of Py 3.11.1, packages and no user .jupyter and .ipython directories (removed them and they were recreated). Outcome is exactly the same: TOC window has the same exact problems.
Commands used:
pip install notebook
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
Well, I am not sure what causes the problem, but I found out that downgrading the notebook package version to before 6.5.1 eliminates the problem:
pip install notebook==6.4.12
In notebook v6.4.12 the problem does not exist. Note that the notebook extension packages are still at their latest (most up-to-date) versions, apparently they do not need to be downgraded: jupyter-contrib-nbextensions is v0.7.0, and jupyter-nbextensions-configurator is v0.6.1.
Related
I am trying to open a Jupyter Notebook file in classic Jupyter Notebook interface. I am attempting to create an interective app that uses Julia programming language in interactive codes. For that I am trying to use the Interact library, because I know it features things such as buttons, sliders, etc. It requires the WebIo extension to be installed. However, from what I have experienced so far, Jupyter notebook does not detect the WebIO extension.
I tried following the instructions at https://juliagizmos.github.io/WebIO.jl/stable/gettingstarted/ and at https://juliagizmos.github.io/WebIO.jl/stable/troubleshooting/not-detected/. In the last link I found that another extension needed to be install and I found more information in this link (https://juliagizmos.github.io/WebIO.jl/latest/providers/ijulia/). I tried executing this command in my Windows prompt and it had apperently been succesful. When executing the command suggested at the second link, I got an error in the Julia REPL saying that WebIO extension for Jupyter Lab must be installed through Python or Conda, which I had already done.
I am also a bit confused as to how I can check to see if the extension is enabled.
I believe the problem has to do either with the installation of IJulia or the pip installation of WebIO. I rarely use pip, so I don't know if I did it correctly.
Thank you.
Here are my steps for installing Jupyter Lab and the Git extension, and then trying to troubleshoot the extension version mismatch problem:
Specs: MacOS Mojave 10.14.6, Jupyter Lab 3.0.5
1. I installed Jupyter Lab using pip3 install jupyterlab
2. I installed the Jupyter Lab Git extension directly from Jupyter Lab's Widgets Manager:
3. After doing so I received additional instructions:
4. I clicked 'OK' and then ran pip3 install jupyterlab-git
5. Back in Jupyter Lab, it said a build was needed to include the latest changes, so I selected 'Rebuild'
6. The build was successful, and I clicked on 'Save and Reload'
7. Upon reloading, I received the following message:
8. I followed the instructions and ran pip3 install --upgrade jupyterlab-git
9. I went back to Jupyter Lab and clicked "Dismiss" on the message.
10. I closed and reopened Jupyter Lab via terminal. After reopening, the same "failed to load" message appeared.
11. I then found this link troubleshooting a similar issue.
12. I followed the advice by running all of the below commands (with pip3, and fixing spelling errors):
13. The user then suggests the following to make sure everything worked OK. So I closed Jupyter Lab again, and ran all of the following:
14. Running jupyter serverextension list I get the following, which I think looks OK:
15. Then I ran pip3 list and get back: jupyterlab-git 0.23.3 (so Git extension version 0.23.3, which according to the GitHub extension page at the time of me writing this is the most current (non-beta) version).
16. Then I ran jupyter labextension list and see nothing related to the Git extension, which is not expected per the above user's screenshots (it's supposed to show the Git Extension here):
17. Now here's one last thing: When I go back and install the Git extension via Jupyter Lab's Extension Manager (like I had done initially), and then I run jupyter labextension list again, I see that the Git extension is the "pre-release" version v0.30.0b1, which would likely be why way back in step 7 I got the error message that the frontend and backend extensions did not match.
And here's where I'm stuck. I can't seem to get these two extension installations to match (or to ever have the extension icon show up in the side panel).
And around and around I go...
EDIT: Possible solution.
After reading my own question here, I thought maybe I should try to install the "pre-release" Git extension version to match the other version, and that seems to have worked. I just didn't think it was best practice to use "pre-release" or beta versions, so that had not occurred to me until just now. So I'm not going to "solve" my own question here, because I'm just not sure this is the best solution... But is it?
I ran this: pip3 install jupyterlab-git==0.30.0b1 and now I'm no longer seeing any version mismatch errors, and the Git extension icon is finally showing up in the side panel.
They versions need to match as per #779
What worked for me was:
pip install --upgrade --pre jupyterlab-git
Currently, a jupyter notebook does not show the lateral table of contents. All the other notebooks do.
In fact, for that notebook under menu->edit the nbextensions config disappeared, so, it looks like that notebook does not load the extension.
My jupyter version is 4.4.0.
How to fix that notebook?
I found the solution to this problem. All those advises like "close and then re-open", "clean output of the notebook" or "re-install extensions" won't work. The problem is in the javascript load timeouts.
In firefox press F12 and press on the red icon in the top right corner - you will see that you have an error
Load timeout for modules:
custom/custom,nbextensions/nbextensions_configurator/config_menu/main,
bla-bla-bla...
How to solve:
close the notebook in jupyter, open your ipynb file in any text editor, go to the end of it - you will find "metadata" section. Add the line
"setTimeout": 120
create a file ~/.jupyter/custom/custom.js if you don't have it (I have Linux, where it is in Windows - I have no idea, google for it) and put this contents into this file:
window.requirejs.config({
waitseconds: 90, // default is 30s
});
This page describes the problem in detail:
https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1195
In my case, disabling my ad-blocker brought the table of contents back.
Apparently, all it needs is to shutdown the notebook. After restarting it, all works fine. I suppose that problem happens when the notebook has been closed wrongly without the proper "close and halt" procedure.
My solution in these cases is, make a copy (File <Make a Copy), delete the original notebook and rename the copy (File <Rename)
For me it seems that one of the following steps worked:
Update all packages and jupyter notebook to the latest version using conda
Uninstall then install again the nbextensions configurator
Reboot the computer
For me the reason was 22 emojis in the headers, deleting 5 of them was enough for firefox to get toc back with no reloading and kernel operations.
I have the problem with Jupyter notebook version 6.1.4. After installing nbextensions and enabling extension "Table of Contents (2)" (as "toc" and "toc2" don't work), I cannot obtain the TOC of an a notebook (2.8 MB), while new notebooks have a table of contents.
Reloading, reopening, restarting jupyter does not help, even after a long wait (> 15 min).
I have tried with browsers Mozilla Firefox version 83 and Chromium version 87.
However, a workaround is to create a new notebook (with TOC), then copy all cells from old notebook to new notebook. In order to do this, this might be useful:
how to copy cells from notebook to notebook and
how to select all cells.
Actually I could not copy all cells at once, I had to do three partial copies.
Alas, my method is not only painful but also ineffective in the long term, as the TOC disappeared again.
Restarting the computer worked or did not work.
Opening a small notebook with a table of content and reloading the big notebook worked or did not work.
The problem concerns all Nbextensions, they are just not active for the big notebook. A Javascript console is shown in Google Chrome with Control Shift J.
Error: Load timeout for modules:
nbextensions/nbextensions_configurator/config_menu/main,nbextensions/init_cell/main,nbextensions/spellchecker/main,nbextensions/toc2/main,nbextensions/jupyter-js-widgets/extension
I've just installed Jupyter Notebook so I can follow the Udemy Python Bootcamp course.
I already had a fully working install of Python 3.71 and Pycharm and then installed Jupyter Notebook with:
pip install jupyter
This was successful other than messages about the some files not being in the PATH environment variable. I manually added the folder to PATH.
I have run Jupyter Notebook at the command prompt with:
jupyter notebook
So far so good - Jupyter Notebook home screen appears in my browser with all the expected folders, Documents, Desktop etc listed.
However if I try and left click on one to see its contents then it pauses for a few seconds and just displays the following (not very descriptive) error:
Server error: error
The error as a screen shot:
I'm absolutely stuck and can't progress my course without Jupyter Notebook.
I'm running Windows 7 Home Premium 64 bit
Firefox (Quantum 64.0)
Bitdefender Internet Security 2018
You can try
pip install --upgrade jupyterhub
I solved the problem using this command.
I am running ipython notebook on my OSX machine and/or my ubuntu 14.04 machine. I am using ipython 3.0.0, and ipython (jupyter) notebooks.
When I start an ipython notebook, under New there is a terminal option, but it's unavailable for me.
I haven't been able to find any documentation on this feature, how to activate it or what it does.
The ipython notebook --help command doesn't mention it and I haven't found anything in the documentation either.
I haven't discovered the special keywords to search google for to get any information either.
What does this feature do? How do I activate it? Is there any documentation on this available?
IPython/Jupyter appears to support browser-based interactive terminal sessions. This is enabled on my machine by installing the terminado package with pip or conda. This fixes the "Terminals Unavailable" message on the drop-down, and lets me start up a (bash) terminal session in a new tab.
See this commit:
IPython on GitHub
Here's the code in Lib/site-packages/IPython/html/notebookapp.py responsible for this item (located the file by searching the source for "Terminals" case-sensitively):
def init_terminals(self):
try:
from .terminal import initialize
initialize(self.web_app)
self.web_app.settings['terminals_available'] = True
except ImportError as e:
log = self.log.debug if sys.platform == 'win32' else self.log.warn
log("Terminals not available (error was %s)", e)
As you can see, there should be a message in the console log specifying what went wrong (you may need to increase log verbosity with ipython notebook --log-level=<level> to see it). In my case, it said:
Terminals not available (error was No module named fcntl)
The html.terminal module that is being imported appears to provide a web-based IPython interactive console.
Support for Windows terminals with terminado dependency was added in Jupyter 5.3.0:
https://github.com/jupyter/notebook/pull/3087
Actually it's jupyter notebook 5.3.0, not jupyter. the two versions is not the same thing.
- jupyter --version
- jupyter notebook --version
I ever suffered from this.