【发布时间】:2020-05-12 09:56:57
【问题描述】:
我正在尝试在 anaconda 中打开 jupyter notebook,但出现 500:内部服务器错误。
我尝试了
的所有解决方案Jupyter Notebook 500 : Internal Server Error
我也试过
pip install update pygments
最后我卸载并安装了anaconda,但还是不行。
错误信息:
[E 19:45:02.700 NotebookApp] Uncaught exception GET /notebooks/Untitled.ipynb (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Untitled.ipynb', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\tornado\web.py", line 1592, in _execute
result = yield result
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\tornado\gen.py", line 1133, in run
value = future.result()
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\tornado\gen.py", line 1147, in run
yielded = self.gen.send(value)
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\notebook\notebook\handlers.py", line 101, in get
get_frontend_exporters=get_frontend_exporters
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\notebook\base\handlers.py", line 507, in render_template
return template.render(**ns)
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\jinja2\environment.py", line 1090, in render
self.environment.handle_exception()
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\jinja2\environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\jinja2\_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\notebook\templates\notebook.html", line 1, in top-level template code
{% extends "page.html" %}
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\notebook\templates\page.html", line 154, in top-level template code
{% block header %}
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\notebook\templates\notebook.html", line 114, in block "header"
{% for exporter in get_frontend_exporters() %}
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\notebook\notebook\handlers.py", line 23, in get_frontend_exporters
from nbconvert.exporters.base import get_export_names, get_exporter
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\nbconvert\__init__.py", line 4, in <module>
from .exporters import *
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\nbconvert\exporters\__init__.py", line 3, in <module>
from .html import HTMLExporter
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\nbconvert\exporters\html.py", line 15, in <module>
from nbconvert.filters.markdown_mistune import IPythonRenderer, MarkdownWithMath
File "C:\Users\m\anaconda3\envs\my_env\lib\site-packages\nbconvert\filters\markdown_mistune.py", line 24, in <module>
from pygments.lexers import get_lexer_by_name
ImportError: cannot import name 'get_lexer_by_name' from 'pygments.lexers' (unknown location)
【问题讨论】:
-
你试过将它安装在同一个 conda env 中吗?
-
你是说jupyter notebook吗?我已经将它安装在同一个环境中。
标签: python jupyter-notebook anaconda