For no particular reason, I've got « RuntimeError: This event loop is already running » when starting Jupyter IPython. I was stucked, unable to run any IPython Notebook. Note that I'm not using Anaconda.
It was probably after updating one library of the Python machine learning ecosystem (Scipy, NumPy, matplotlib, scikit-learn, pandas, Keras, ...) but I cannot remember which one.
I've tried to upgrade the usual suspects, tornado and ipykernel, with no success. Furthermore I'm not using any fancy thing like asyncio in my own code.
After trying many things and probably making the situation worse, I've finally solved the problem.
1) Uninstall IPython
sudo pip3 uninstall -y jupyter jupyter_core jupyter-client jupyter-console notebook qtconsole nbconvert nbformat
2) Reinstall fresh Jupyterlab
sudo pip3 install jupyterlab
Et voilà!
I have just installed jupyter_contrib_nbextensions by:
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
When I open a jupyter notebook and navigate to Edit -> nbextensions config, I see the below screen:
All extensions are marked as "possibly incompatible". A solution is to uncheck the option: "disable configuration for nbextensions without explicit compatibility". But is it safe? Any ideas why the nbextensions are incombatible?
My package versions are:
jupyter==1.0.0
notebook==6.0.1
jupyter-contrib-nbextensions==0.5.1
As you will notice, in version 0.5.1 of jupyter_contrib_nbextensions most of the nbextensions are compatible with versions 4.X and 5.X. For example look at this extension:
It you uncheck the option "disable configuration for nbextensions without explicit compatibility", you will most probably have no problem using any extension. I guess that the developers haven't yet tested the jupyter_contrib_extensions against the new notebook version 6.X which was recently launched. If you want to have a stable and tested environment, you can roll back to a previous jupyter notebook version. The most recent compatible one is 5.7.8. Just uninstall current notebook and install that specific version by executing:
pip uninstall notebook
pip install notebook==5.7.8
I am running jupyter notebook through Anaconda Navigator.
I tried installing variable explorer extension,
Although I was successful in installing the extension but I am not able to install its java and css dependencies
! pip install jupyter_contrib_nbextensions
This works , however this doesn't works
jupyter contrib nbextension install --user
Any help will be apreciated
Can you give it a try by using command:
jupyter nbextension enable varInspector/main
It worked for me.
I tried to install jupyter_contrib_nbextensions : http://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html
Everything worked fine but when I open a notebook nothing changes. I can't see the new tool bar that I'm supposed to see.
When I reinstall the Extension, the process is the same (I don't have a message tellign me that the files already exists). I don't have an error. So I can't figure out why it doesn't work.
Thanks a lot.
Follow 3 steps: In Terminal
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable varInspector/main
after this you will see "Vaildating: ok"
Now you can open jupyter notebook you will see the require changes
Update Jan 2021
I was seeing this issue using the latest from pip packages.
Turns out it was related to:
https://discourse.jupyter.org/t/the-static-notebook-js-mathjaxutils-js-is-missing/7303
Basically, jupyter-notebook moved a .js file in a recent update causing the extensions tab to no longer appear.
Reverting to an older version works-around the issue:
pip install notebook==6.1.5
Also note that a substantial number of the extensions aren't officially supported by the 6.x version. So you may be better off reverting to 5.x until your desired extensions are 'officially' supported:
pip install notebook==5.7.10
Following are the commands which installs the jupyter nb_extensions
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
The second command might give you below error:
jupyter contrib not found
Above command can be resolved as below:
- open cmd to install manually
cd .\Python\<your-python-version>\Lib\site-packages\jupyter_contrib_nbextensions
python application.py install
- Restart the jupyter notebook server
Note: Also make sure that your packages jupyter , notebook and your jupyter_contrib_nbextensions are installed for same version of python (and same --user if you have installed all your packages with --user flag)
First, follow this SO-post (go to the update) to install the extension.
Then shutdown the notebook server.
Then type $ jupyter nbextension enable varInspector/main.
If it says OK, you can start your notebook and should see the crosshair.
try to run this
jupyter contrib nbextension install --user
then relaunch the Jupyter notebook.
this might solve the problem as it did for me.
Try this out ->
1)Open Anaconda Prompt.
2)Type in -
conda install -c conda-forge jupyter_contrib_nbextensions
(if c is the default directory)
3)Proceed with the installation.
4)Exit the Anacodna prompt.
5)Relaunch Jupyter notebook.
(You will now see nbextensions tab)
Following steps with Anaconda Prompt ->
1)Open Anaconda Prompt.
2)Type in -
conda install -c conda-forge jupyter_contrib_nbextensions
Enter 'y' for installation.
type in jupyter contrib nbextension install --sys-prefix
4)Exit the Anacodna prompt.
5)Relaunch Jupyter notebook. (You will now see nbextensions tab)
Screenshot of my installation
1 quick info -
1. even after enabling nbextensions, from the notebooks tree page,
2. you need to activate it on your Jupyter notebook.
See below.
Running following command one by one !!!
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension enable spellchecker/main
jupyter nbextension enable codefolding/main
Posting this solution because it took me 20 minutes to figure out why my interface looked so different from all of the screenshots everyone else was posting. I hope it can prevent some other soul from making the same mistake I did:
I was running my Jupyter Notebook with the command jupyter-lab instead of jupyter notebook. I understand there are functional differences between the two, but in my case having spellcheck was much more important than any of the difference the two provided. As soon as I used jupyter notebook instead, it worked perfectly.
UPDATE, FEBRUARY 2023:
I first installed nbextensions using pip. Then I couldn't run the second command jupyter contrib nbextension install --user as the others and got the error Exception: Jupyter command 'jupyter-contrib' not found.
So, I tried installing using conda with this command:
conda install -c conda-forge jupyter_contrib_nbextensions
NOTE 1: I had to run my Anaconda prompt in "Administration Mode" in order to be able to install using conda.
After that I could run the second command:
jupyter contrib nbextension install --user
And it's working now.
NOTE 2: I'm using the latest version of anaconda so I DID NOT need to revert my jupyter version as mentioned here.
Downgrading the notebook version to 5.6.0 worked for me.
pip install notebook==5.6.0
If this doesn't work for you, then return to your original version.
Good luck.
I followed the highest voted answer to install the nbextensions but received an error when I reboot the Jupyter Notebook:
404 GET /nbextensions/nbextensions_configurator/tree_tab/main.js?v=20220513151408
It seemed that what I've installed can not be found by Jupyter Notebook.
After checking the detailed installation log in the terminal, I found Nbextension has been installed into the python2.7 directory:
./Library/Python/2.7/lib/python/site-packages (from jupyter_contrib_nbextensions)
I am currently using Python 3 in Jupyter Notebook so I decided to uninstall what I have and reinstall Nbextension using pip3 instead of pip. Then I reboot Jupyter Notebook and saw the Nbextensions tab (next to the tab Clusters)!
In sum, based on my attempt, I would recommend using pip3 instead of pip to avoid an installation in Python 2 directory.
My installed package version (windows 11):
notebook 6.5.2
jupyter-contrib-nbextensions 0.7.0
jupyter-nbextensions-configurator 0.6.1
Though I can not get the nbextensions menu tab out using the methods mentioned in the previous try outs of this post, I can still use the jupyter nbextension enable <require path> command in the ../python3/scripts folder as following examples which I use frequently:
jupyter nbextension enable varInspector/main
jupyter nbextension enable toc2/main
jupyter nbextension enable execute_time/ExecuteTime
jupyter nbextension enable hide_input/main
jupyter nbextension enable splitcell/splitcell
jupyter nbextension enable code_prettify/code_prettify
Then the variable inspector, table of contents, split cell, hide inputs and code prettify buttons appear in the notebook page. Other extensions can be tried replacing command's <require path> which can be found under the older version's notebook extensions tab that doesn't have the problem.
Change old path notebook/js/mathjaxutils to base/js/mathjaxutils.js to load the dependency correctly.
This solve my problem.
For details see this Github issue about this bug.
I've installed anaconda and that came with its own Jupyter version so I want to uninstall the Jupyter that I installed using pip3. I searched for instruction and tried using pip3 uninstall Jupyter, but that does not seem correct because I get the following, which it says is Jupyter 1.0.0:
Uninstalling jupyter-1.0.0:
/usr/local/lib/python3.6/site-packages/__pycache__/jupyter.cpython-36.pyc
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/DESCRIPTION.rst
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/INSTALLER
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/METADATA
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/RECORD
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/WHEEL
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/metadata.json
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/pbr.json
/usr/local/lib/python3.6/site-packages/jupyter-1.0.0.dist-info/top_level.txt
/usr/local/lib/python3.6/site-packages/jupyter.py
I know I can also try pip3 uninstall notebook, but that shows a bunch of files that I'm not sure is actually Jupyter.
This must seem like such a simple question, but I've searched and haven't found clear answer. Thank you!
Unfortunately there's no simple solution. The "pip install jupyter" command installs various dependencies and so you'll probably have to uninstall them all seperately.
The packages associated with Jupyter are:
notebook
nbconvert
nbformat
ipykernel
ipywidgets
qtconsole
traitlets
tornado
anything with jupyter in front of it (jupyter_core, jupyter_client etc.)
ipython_genutils
jinja2
Some of these aren't Jupyter only (tornado, qtconsole, jinja2 etc) but if you're sure you're not using them then feel free to uninstall.