添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account jupyter notebook list show error "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)" #5860 jupyter notebook list show error "json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)" #5860 ttpro1995 opened this issue Nov 12, 2020 · 9 comments

It show error

Traceback (most recent call last):
  File "/home/cpu11453/miniconda3/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/home/cpu11453/miniconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 270, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/cpu11453/miniconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 845, in launch_instance
    app.start()
  File "/home/cpu11453/miniconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 2195, in start
    super(NotebookApp, self).start()
  File "/home/cpu11453/miniconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 259, in start
    self.subapp.start()
  File "/home/cpu11453/miniconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 596, in start
    serverinfo_list = list(list_running_servers(self.runtime_dir))
  File "/home/cpu11453/miniconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 2295, in list_running_servers
    info = json.load(f)
  File "/home/cpu11453/miniconda3/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/home/cpu11453/miniconda3/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/home/cpu11453/miniconda3/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/home/cpu11453/miniconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Expectation: list all running instance if any.

jupyter notebook list simply reads JSON files named nbserver-pid.json in the Jupyter runtime directory (found via jupyter --runtime). Check those files to ensure there's nothing out of the ordinary. The content should be JSON and resemble the following...

"base_url": "/", "hostname": "localhost", "notebook_dir": "/Users/kbates/.jupyter", "password": false, "pid": 39736, "port": 8888, "secure": false, "sock": "", "token": "78905550521d33869297b7a8e0a7618ab990da77091f7764", "url": "http://localhost:8888/"

Just create a folder in the Jupyter runtime directory. Backup by Moving all the .json files there.
Then start a new notebook and try 'jupyter notebook list' again.

jupyter notebook
  • jupyter notebook list
    seem to resolve decode error but has a blank input just as
    jupyter lab list
    jupyter server list
    however runned instances are seen in
    ps aux | grep jupyter
    which is suprising due to Run notebook without requesting for stupid token #2254 (comment)
  • I just deleted the folder:
    /home/USER/.local/share/jupyter
    And restarted jupyter lab. Then it was working for me. Jupyter lab will create this folder again after starting.
    But attention: Some settings might get lost! It is therefore maybe worth saving the folder just in case you want to recover it again.