Error loading Jupyter Notebook Extensions
Asked Answered
I

8

31

I am using a Macbook with OS Sierra, and running Python 3.6.1 and Jupyter Notebook Server 5.0.0 I installed Jupyter Notebook extensions, following the instructions as mentioned on https://github.com/ipython-contrib/jupyter_contrib_nbextensions

While the notebooks work fine on my system, I cannot view the nbextensions tab. The following is the error log I see on running jupyter notebook in terminal. I have seen some related problems posted here on SO, but they seem to be about installing specific extensions.

Further, one of the solutions seemed to be suggest pip install jupyter_nbextensions_configurator, but as can be seen from the output below, I already have the extension installed.

Requirement already satisfied: traitlets in /usr/local/lib/python3.6/site-packages (from jupyter_nbextensions_configurator)
Requirement already satisfied: tornado in /usr/local/lib/python3.6/site-packages (from jupyter_nbextensions_configurator)

However, in the logs, you will notice that ModuleNotFoundError: No module named 'jupyter_nbextensions_configurator' is one of the error messages.

[W 08:44:49.973 NotebookApp] server_extensions is deprecated, use nbserver_extensions
[W 08:44:50.146 NotebookApp] Error loading server extension jupyter_nbextensions_configurator
    Traceback (most recent call last):
      File "/usr/local/lib/python3.6/site-packages/notebook/notebookapp.py", line 1271, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 978, in _gcd_import
      File "<frozen importlib._bootstrap>", line 961, in _find_and_load
      File "<frozen importlib._bootstrap>", line 948, in _find_and_load_unlocked
    ModuleNotFoundError: No module named 'jupyter_nbextensions_configurator'
[I 08:44:50.158 NotebookApp] Serving notebooks from local directory: /Users/sp
[I 08:44:50.158 NotebookApp] 0 active kernels
[I 08:44:50.158 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=c777a7ab5dc6cf416c238b7b37f58d10ebea9db0743b46ae
[I 08:44:50.158 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 08:44:50.163 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=c777a7ab5dc6cf416c238b7b37f58d10ebea9db0743b46ae
[I 08:44:51.633 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[W 08:44:54.407 NotebookApp] 404 GET /nbextensions/nbextensions_configurator/tree_tab/main.js?v=20170511084449 (::1) 25.76ms referer=http://localhost:8888/tree

What am I missing here? Thanks!

Individuate answered 11/5, 2017 at 13:9 Comment(0)
S
29

I had the same problem. Here is how I solved it.

I have downloaded Anaconda python version 3.7. I already had Python 3.6.7 on my system.

I'd get this error if I did:

pip install jupyter_contrib_nbextensions

To solve it, I did:

python3.7 -m pip install jupyter_contrib_nbextensions

I have not tried this, but this could solve your problem too:

conda install -c conda-forge jupyter_nbextensions_configurator

So I guess the problem is because of there being multiple versions of Python on your system. The one which Anaconda uses and the one which the "normal pip" uses are probably different.

Skep answered 15/1, 2019 at 17:35 Comment(3)
Python should default to the environment's python: python -m pip install jupyter_contrib_nbextensions should work.Flo
fwiw, i was had jupyter installed on both my virtualenv as well as globally, and the command "jupyter" by default picked up the global env. So, I fixed my issue by running the jupyter binary from the virtualenv (./<venv>/bin/jupyter)Takishatakken
This specific incongruity strikes me as a $PYTHONUSERBASE issue (i.e. stuff ending up in ~/.local/python, which can be fixed with say conda env config vars set PYTHONUSERBASE=$CONDA_PREFIX). (I have a different issue, so cannot confirm)Conceivable
R
13

I solved this problem by removing jupyter-notebook, jupyter_contrib_nbextensions, and jupyter_nbextensions_configurator, and starting it from scratch.

Note: It only works on Anaconda environment.

Uninstallation

For the different source of installation, you can remove these package through:

pip uninstall jupyter
pip uninstall jupyter_contrib_nbextensions
pip uninstall jupyter_nbextensions_configurator

or

conda remove --force jupyter notebook
conda remove --force jupyter_nbextensions_configurator
conda remove --force jupyter_contrib_nbextensions

But I'd advise you to run both of the above commands.

Installation

It's better to install all the packages from anaconda:

conda update notebook
conda install jupyter notebook
conda install -c conda-forge jupyter_nbextensions_configurator
conda install -c conda-forge jupyter_contrib_nbextensions

Rossetti answered 26/8, 2019 at 11:4 Comment(4)
Some of us are not in a position to use Conda. A solution is needed that addressed the needs of all jupyter notebook users.Delectate
@Delectate I have added a note in the answer now. Thanks for your suggestion!Rossetti
@Delectate ... The above solution does not actually use "Anaconda", it uses conda, which is an open source package. Why would you not be able to use conda? Are you in a locked-down IT environment?Dejong
I did both conda and jupyter. It helped me revive the previous state. Thanks!Disinterested
B
1

I had the same problem, but I notice in the README of jupyterlab this:

Prerequisites

Jupyter notebook version 4.3 or later. To check the notebook version:

jupyter notebook --version

So, try to check your version with that command, if returns a version lower than 4.3, try update it:

conda update notebook

That is how I solved the problem.

Bluenose answered 24/8, 2017 at 12:51 Comment(0)
P
0

It looks, from the server traceback, as though you've potentially got something weird going on with multiple python installs. Note that you're installing into a python in

/usr/local/lib/python3.6

but your notebook server traceback goes from there (where notebookapp seems to be running), but crosses over (in the importing call) to running from a (homebrew?) Python installed at

/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6

A potentially hackish solution might be to just install into that cellar, and carry on as before, but I'd suggest maybe a little more investigation to decide why this is happening. Of relevance may be how you start the notebook server, install modules, run terminals, setup python paths, etc...

Pentecostal answered 20/11, 2017 at 11:18 Comment(0)
K
0

I just had the same question, and i successfully fixed it by changing to specific environment (for example, tensorflow or py36), and then input "jupyter notebook". It works!

Kenweigh answered 24/8, 2018 at 11:22 Comment(0)
C
0

I solved my problem by switching to the base environment in Anaconda and installing those packages. At the very beginning, I created a new environment in Anaconda because some conda-forge packages could not be installed. I used 'pip install' in my new environment. I installed those packages and the tab was not showing. The reason is even if I activated the new environment, the jupyter notebook is still initialed in the base environment. That is why the jupyter nootbook said 'no module found' in the beginning.

Casein answered 9/6, 2020 at 2:32 Comment(0)
I
0

never use pip if you feel that there might be conflicts in the installation. Always use conda to take care of installation conflicts. considering the situation, I believe conda is the best package installer method to install anything in the live instance.

Iand answered 1/8, 2024 at 10:25 Comment(0)
U
-1

I had the same error for a long time. Reinstalling nbconfig, changing settings, giving it extra time to load, validating installation before opening the notebook, etc. did not help.

What worked for me in the end was switching browsers! I switched from Safari on my Mac to Chrome and things are working perfectly! (Safari Version 13.0.2, mac OS High Sierra 10.13.6, Chrome Version 83.0.4103.61)

Unweave answered 30/5, 2020 at 19:36 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.