ipython-contrib / jupyter_contrib_nbextensions

A collection of various notebook extensions for Jupyter
http://jupyter-contrib-nbextensions.readthedocs.io/en/latest
Other
5.23k stars 806 forks source link

install causing '500 : Internal Server Error' when opening notebook #1347

Open maajdl opened 6 years ago

maajdl commented 6 years ago

Hello,

I just freshly installed Anaconda3. Then, I installed jupyter_contrib_nbextensions like this:

pip install jupyter_contrib_nbextensions

Starting Jupyter was fine, but I noticed this message in the Nbextension tab:

Traceback (most recent call last):
  File "C:\Users\Gabrielle\Anaconda3\lib\site-packages\tornado\web.py", line 1541, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "C:\Users\Gabrielle\Anaconda3\lib\site-packages\tornado\web.py", line 2949, in wrapper
    return method(self, *args, **kwargs)
  File "C:\Users\Gabrielle\Anaconda3\lib\site-packages\notebook\services\config\handlers.py", line 19, in get
    self.finish(json.dumps(self.config_manager.get(section_name)))
  File "C:\Users\Gabrielle\Anaconda3\lib\site-packages\notebook\services\config\manager.py", line 25, in get
    recursive_update(config, cm.get(section_name))
  File "C:\Users\Gabrielle\Anaconda3\lib\site-packages\notebook\config_manager.py", line 103, in get
    recursive_update(data, json.load(f))
  File "C:\Users\Gabrielle\Anaconda3\lib\json\__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Users\Gabrielle\Anaconda3\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Gabrielle\Anaconda3\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Gabrielle\Anaconda3\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Opening a notebook produces then this error:

500 : Internal Server Error

I then tried to uninstall and install back from github tarball, to no avail.

I like the Nbextension, I hope you can easily find a fix!

Best regards,

Michel

clatonhendricks commented 5 years ago

Were you able to find a solution. I get the same error

Regards, Claton

clatonhendricks commented 5 years ago

@maajdl I was able to resolve the prb. For me notebook.json file was empty so I copied the contents of a working machine and it worked. Here are details. File location - C:\Users\.jupyter\nbconfig\notebook.json

File contents: { "load_extensions": { "snippets/main": true, "cell_filter/cell_filter": false, "varInspector/main": true, "execute_time/ExecuteTime": false, "toggle_all_line_numbers/main": true, "scratchpad/main": true, "freeze/main": false, "table_beautifier/main": false, "hinterland/hinterland": true, "hide_input/main": false, "MarkdownCell": { "cm_config": { "lineWrapping": true } }, "CodeCell": { "cm_config": { "lineWrapping": true } }, "nbextensions_configurator/config_menu/main": true } }

Once you edit the contents of notebook.json then restart your Jupyter notebook and it should work.

HTH, Claton

ghost commented 5 years ago

@clatonhendricks Hey Claton, I think that I have a similar problem to the one mentioned above and when I open my notebook.json file with VisualStudio I see this:

image

However, I don't know if that means it's considered empty? I have never opened it before now. With your solution, do you think that I could copy and paste what you wrote for file contents above? I just don't want to disturb the contents of the file because I don't really know what I am doing with it.