在Jupyter Notebook 中打开一个 ipynb后缀的文件,在浏览器打开中报 500 Internal Server Error
C:\Users\Administrator>jupyter notebook
[I 22:10:16.789 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.1
[I 22:10:17.856 NotebookApp] JupyterLab beta preview extension loaded from f:\anaconda3\lib\site-packages\jupyterlab
[I 22:10:17.856 NotebookApp] JupyterLab application directory is f:\anaconda3\share\jupyter\lab
[I 22:10:25.688 NotebookApp] Serving notebooks from local directory: D:\Jupyter Notebook
[I 22:10:25.691 NotebookApp] The Jupyter Notebook is running at:
[I 22:10:25.692 NotebookApp] http://localhost:8888/?token=8541813eab31299a95e2cb50c2a301e5f4f2068c525408bd
[I 22:10:25.692 NotebookApp] or http://127.0.0.1:8888/?token=8541813eab31299a95e2cb50c2a301e5f4f2068c525408bd
[I 22:10:25.693 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 22:10:25.789 NotebookApp]
To access the notebook, open this file in a browser:
file:///C:/Users/Administrator/AppData/Roaming/jupyter/runtime/nbserver-5656-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=8541813eab31299a95e2cb50c2a301e5f4f2068c525408bd
or http://127.0.0.1:8888/?token=8541813eab31299a95e2cb50c2a301e5f4f2068c525408bd
[E 22:10:36.586 NotebookApp] Uncaught exception GET /api/config/notebook?_=1622297431435 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/api/config/notebook?_=1622297431435', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "f:\anaconda3\lib\site-packages\tornado\web.py", line 1697, in _execute
[E 22:14:13.982 NotebookApp] 500 GET /notebooks/Work/%E5%86%99%E5%85%A52%E6%9C%88%E6%95%B0%E6%8D%AE.ipynb (::1) 760.57ms referer=http://localhost:8888/tree/Code
,,,,,,
result = method(*self.path_args, **self.path_kwargs)
File "f:\anaconda3\lib\site-packages\tornado\web.py", line 3174, in wrapper
return method(self, *args, **kwargs)
File "f:\anaconda3\lib\site-packages\notebook\services\config\handlers.py", line 18, in get
self.finish(json.dumps(self.config_manager.get(section_name)))
File "f:\anaconda3\lib\site-packages\notebook\services\config\manager.py", line 25, in get
recursive_update(config, cm.get(section_name))
File "f:\anaconda3\lib\site-packages\notebook\config_manager.py", line 102, in get
recursive_update(data, json.load(f))
File "f:\anaconda3\lib\json\__init__.py", line 299, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "f:\anaconda3\lib\json\__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "f:\anaconda3\lib\json\decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "f:\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)
打开 Anaconda Prompt
然后输入 下列命令
pip install --upgrade nbconvert
安装完毕后,再重启Jupyter Notebook 就可以了