問題
你運行一個Python筆記本,它失敗了錯誤的顏色格式消息。
一個堆棧跟蹤示例:
文件“/local_disk0/tmp/1599775649524-0/PythonShell.py”,第39行,在<模塊> from IPython.nbconvert.filters.ansi import ansi2html File”中。_bootstrap>”,第983行,在_find_and_load文件中“ ”,第963行,在_find_and_load_unlocked File中“ ”,第902行,在_find_spec文件中“ ",第876行,in _find_spec_legacy File "/databricks/python/lib/python3.7/site-packages/IPython/utils/shimmodule.py",第36行,in find_module mod = import_item(mirror_name) File "/databricks/python/lib/python3.7/site-packages/IPython/utils/importstring.py",第31行,in import_item module = __import__(package, fromlist=[obj]) File "/databricks/python/lib/python3.7/site-packages/nbconvert/__init__.py",第4行,在<模塊> from .exporters import * File "/databricks/python/lib/python3.7/site-packages/nbconvert/ exports /__init__.py"中,第4行,在<模塊> from .slides import slidesexporters File "/databricks/python/lib/python3.7/site-packages/nbconvert/ exports /slides.py"中,第12行,在<模塊> from ..preprocessors中。“/databricks/python/lib/python3.7/site-packages/nbconvert/preprocessors/__init__.py”,第7行,在<模塊> from .csshtmlheader import CSSHTMLHeaderPreprocessor File "/databricks/python/lib/python3.7/site-packages/nbconvert/preprocessors/csshtmlheader.py",第14行,在<模塊> from jupyterlab_pyportals import JupyterStyle File "/databricks/python/lib/python3.7/site-packages/ jupyterlab_pyportals /__init__.py",第4行,在<模塊> from .style import JupyterStyle File "/databricks/python/lib/python3.7/site-packages/ jupyterlab_pydings / Style .py",第10行,在<模塊> class JupyterStyle(Style): File "/databricks/python/lib/python3.7/site-packages/ pydings / Style .py",第101行,在__new__ ndef[0] = colorformat(styledef) File "/databricks/python/lib/python3.7/site-packages/ pydings / Style .py",第58行,in colorformat assert False, "wrong colorformat %r" % text AssertionError:錯誤的顏色格式'var(——jsp -mirror-editor-variable-color)'
導致
的不兼容版本造成的nbconvert圖書館。如果你沒有nbconvert被固定到正確的版本,就有可能通過PyPI不小心安裝一個不兼容的版本。
解決方案
手動安裝nbconvert集群上的版本6.0.0rc0。這將覆蓋可能已安裝的庫的任何不正確版本。
- 單擊側邊欄中的集群圖標。
- 單擊集群名稱。
- 單擊庫選項卡。
- 點擊安裝新.
- 在Library Source按鈕列表中,選擇PyPi.
- 輸入nbconvert = = 6.0.0rc0在包字段。
- 點擊安裝.