2

I have installed Anaconda3 5.0.1 for windows. Afterwards, I installed nbextensions for Jupyter notebook.

I have used following code in Anaconda Prompt for nbextension installation: pip install jupyter_contrib_nbextensions jupyter-contrib nbextension install

When i open Jupyter notebook and click on NBextensions tab, I see the following error and no extensions are added to my notebooks.

Snap! Failed to load config section "notebook"
Internal Server Error
Traceback (most recent call last):
  File "C:\Users\Efseaff\Anaconda3\lib\site-packages\notebook\base\handlers.py", line 516, in wrapper
    result = yield gen.maybe_future(method(self, *args, **kwargs))
  File "C:\Users\Efseaff\Anaconda3\lib\site-packages\tornado\web.py", line 2898, in wrapper
    return method(self, *args, **kwargs)
  File "C:\Users\Efseaff\Anaconda3\lib\site-packages\notebook\services\config\handlers.py", line 20, in get
    self.finish(json.dumps(self.config_manager.get(section_name)))
  File "C:\Users\Efseaff\Anaconda3\lib\site-packages\notebook\services\config\manager.py", line 25, in get
    recursive_update(config, cm.get(section_name))
  File "C:\Users\Efseaff\Anaconda3\lib\site-packages\traitlets\config\manager.py", line 63, in get
    return json.load(f)
  File "C:\Users\Efseaff\Anaconda3\lib\json\__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Users\Efseaff\Anaconda3\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Efseaff\Anaconda3\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Efseaff\Anaconda3\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 5 column 3 (char 72)

In a related question on Github - https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1295 - the questioner is directed to check their Failed JSON file : C:\Users\ ... \nbconfig\notebook.json in https://jsonlint.com/

My C:...\notebook.json file is:

{
  "load_extensions": {
    "jupyter-js-widgets/extension": true
  }
  "CodeCell": {
    "cm_config": {
      "autoCloseBrackets": false,
      "cursorBlinkRate": 0
    }
  } 
}

The output of https://jsonlint.com/ is:

Error: Parse error on line 4:
...xtension": true  }   "CodeCell": {       "cm_
---------------------^
Expecting 'EOF', '}', ',', ']', got 'STRING'

Please help me fix this file

SOLVED

The steps on https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html#install-javascript-and-css-files don't explicitly show to configure them with: pip install jupyter_nbextensions_configurator and jupyter nbextensions_configurator enable --system I found them ... elsewhere.

Matthew
  • 51
  • 1
  • 10
  • 1
    When you did the second step of the installation, specifically `jupyter contrib nbextension install `, was it as a separate line and not as you posted? And did you add `--user` or `--system` to the end as advised [there](https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html#install-javascript-and-css-files)? I don't know if it defaults to one of those on its own. – Wayne Feb 20 '20 at 16:52
  • 2
    Thanks @Wayne. The steps were separate. I had added --system. SOLVED: I needed `pip install jupyter_nbextensions_configurator` and `jupyter nbextensions_configurator enable --system`. – Matthew Feb 20 '20 at 17:17

0 Answers0