Jupyter Notebook 500:打开文件时出现内部服务器错误

时间:2019-12-11 22:54:51

标签: python jupyter-notebook jupyter

我知道在[这里] [1]和[这里] [2]等地方也曾问过同样的问题。我尝试了所附两个链接中的所有解决方案,但均无效果。似乎存在一些不一致的问题。我不是来自CS背景,也不确定如何解决该问题。请帮忙,我真的很感激。我附上以下错误消息。

[I 16:53:05.932 NotebookApp] Loading IPython parallel extension
[W 16:53:05.934 NotebookApp] Error loading server extension jupyter_nbextensions_configurator
    Traceback (most recent call last):
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/notebookapp.py", line 1655, in init_server_extensions
        mod = importlib.import_module(modulename)
      File "/Users/MaoLin/anaconda/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 678, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jupyter_nbextensions_configurator/__init__.py", line 16, in <module>
        import yaml
    ModuleNotFoundError: No module named 'yaml'
[I 16:53:05.969 NotebookApp] JupyterLab extension loaded from /Users/MaoLin/anaconda/lib/python3.6/site-packages/jupyterlab
[I 16:53:05.969 NotebookApp] JupyterLab application directory is /Users/MaoLin/anaconda/share/jupyter/lab
[I 16:53:05.972 NotebookApp] Serving notebooks from local directory: /Users/MaoLin/Documents/LookingForJobs/Machine_Learning
[I 16:53:05.972 NotebookApp] The Jupyter Notebook is running at:
[I 16:53:05.973 NotebookApp] http://localhost:8888/?token=25ef02efa3aae320806e5d2bfefb28632d5dd6b9832c73af
[I 16:53:05.973 NotebookApp]  or http://127.0.0.1:8888/?token=25ef02efa3aae320806e5d2bfefb28632d5dd6b9832c73af
[I 16:53:05.973 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:53:05.979 NotebookApp] 

    To access the notebook, open this file in a browser:
        file:///Users/MaoLin/Library/Jupyter/runtime/nbserver-51755-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=25ef02efa3aae320806e5d2bfefb28632d5dd6b9832c73af
     or http://127.0.0.1:8888/?token=25ef02efa3aae320806e5d2bfefb28632d5dd6b9832c73af
[W 16:53:08.210 NotebookApp] 404 GET /nbextensions/nbextensions_configurator/tree_tab/main.js?v=20191211165305 (::1) 8.90ms referer=http://localhost:8888/tree
[E 16:53:11.126 NotebookApp] Uncaught exception GET /notebooks/quad_cnn_2class.ipynb (::1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/quad_cnn_2class.ipynb', version='HTTP/1.1', remote_ip='::1')
    Traceback (most recent call last):
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/tornado/web.py", line 1697, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/tornado/web.py", line 3174, in wrapper
        return method(self, *args, **kwargs)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/notebook/handlers.py", line 96, in get
        get_frontend_exporters=get_frontend_exporters
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/base/handlers.py", line 507, in render_template
        return template.render(**ns)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
        return original_render(self, *args, **kwargs)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
        return self.environment.handle_exception(exc_info, True)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
        reraise(exc_type, exc_value, tb)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
        raise value.with_traceback(tb)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/templates/notebook.html", line 114, in block "header"
        {% for exporter in get_frontend_exporters() %}
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/notebook/notebook/handlers.py", line 37, in get_frontend_exporters
        exporter_class = get_exporter(name)
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/nbconvert/exporters/base.py", line 98, in get_exporter
        return entrypoints.get_single('nbconvert.exporters', name).load()
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/entrypoints.py", line 82, in load
        mod = import_module(self.module_name)
      File "/Users/MaoLin/anaconda/lib/python3.6/importlib/__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 994, in _gcd_import
      File "<frozen importlib._bootstrap>", line 971, in _find_and_load
      File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 678, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jupyter_contrib_nbextensions/__init__.py", line 5, in <module>
        import jupyter_nbextensions_configurator
      File "/Users/MaoLin/anaconda/lib/python3.6/site-packages/jupyter_nbextensions_configurator/__init__.py", line 16, in <module>
        import yaml
    ModuleNotFoundError: No module named 'yaml'
[E 16:53:11.131 NotebookApp] {
      "Host": "localhost:8888",
      "Connection": "keep-alive",
      "Upgrade-Insecure-Requests": "1",
      "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
      "Referer": "http://localhost:8888/tree",
      "Accept-Encoding": "gzip, deflate, br",
      "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
      "Cookie": "_xsrf=2|07d66bc1|e013d2a137386e0728a5eaa5fa40c8a1|1576098930; username-localhost-8888=\"2|1:0|10:1576104787|23:username-localhost-8888|44:YjA0OTQ1YzM3ZGFiNDJiNGI0ZTQ4M2Q2ZTVlMGZjOGY=|464e908b1046a573bff651d5d5a66f98e0176907f2303b358fec7ad45d180a21\""
    }
[E 16:53:11.131 NotebookApp] 500 GET /notebooks/quad_cnn_2class.ipynb (::1) 233.14ms referer=http://localhost:8888/tree


  [1]: https://github.com/jupyter/notebook/issues/3629
  [2]: https://stackoverflow.com/questions/36851746/jupyter-notebook-500-internal-server-error

0 个答案:

没有答案