问题
你运行一个Python笔记本和失败AssertionError:错误的颜色格式消息。
堆栈跟踪:一个例子
文件“/ local_disk0 / tmp / 1599775649524 - 0 / PythonShell。py”, 39岁,从IPython.nbconvert.filters <模块>。ansi ansi2html文件导入“< importlib冻结。_bootstrap >”,第983行_find_and_load文件”< importlib冻结。_bootstrap >”,第963行_find_and_load_unlocked文件”< importlib冻结。_bootstrap >”,第902行_find_spec文件”< importlib冻结。_bootstrap >”, 876行,在_find_spec_legacy文件“/砖/ python / lib / python3.7 /网站/ IPython / shimmodule跑龙套。py”,第36行find_module mod = import_item (mirror_name)文件“/砖/ python / lib / python3.7 /网站/ IPython / importstring跑龙套。py”第31行,在import_item模块= __import__(包,fromlist = (obj))文件”/砖/ python / lib / python3.7 /网站/ nbconvert / __init__。py”, 4号线,在<模块> .exporters导入*文件“/砖/ python / lib / python3.7 /网站/ nbconvert /出口商/ __init__。py”, 4号线,在<模块> .slides SlidesExporter文件导入”/砖/ python / lib / python3.7 /网站/ nbconvert /出口商/幻灯片。py”第12行,在<模块> . .预处理器。基地导入预处理器文件“/砖/ python / lib / python3.7 /网站/ nbconvert /预处理器/ __init__。py”,第7行,在<模块> .csshtmlheader CSSHTMLHeaderPreprocessor文件导入”/砖/ python / lib / python3.7 /网站/ / csshtmlheader nbconvert /的预处理器。py”第14行,在<模块> jupyterlab_pygments JupyterStyle文件导入”/砖/ python / lib / python3.7 /网站/ jupyterlab_pygments / __init__。py”, 4号线,在<模块> .style JupyterStyle文件导入”/砖/ python / lib / python3.7 /网站/ jupyterlab_pygments /风格。py”, 10号线,在<模块>类JupyterStyle(风格):文件”/砖/ python / lib / python3.7 /网站/ pygments /风格。py", line 101, in __new__ ndef[0] = colorformat(styledef) File "/databricks/python/lib/python3.7/site-packages/pygments/style.py", line 58, in colorformat assert False, "wrong color format %r" % text AssertionError: wrong color format 'var(--jp-mirror-editor-variable-color)'
导致
这是由一个不兼容的版本的nbconvert图书馆。如果你没有nbconvert固定在正确的版本,可以通过PyPI无意中安装一个不兼容的版本。
解决方案
手动安装nbconvert版本6.0.0rc0集群。这将覆盖任何错误版本的库,可能已经安装了。
- 单击图标栏的集群。
- 单击集群名称。
- 单击库选项卡。
- 点击安装新。
- 在库源按钮列表中,选择PyPi。
- 输入nbconvert = = 6.0.0rc0在包字段。
- 点击安装。