我在";源";文件夹,并使用CCD_ 1命令重建HTML。一切正常,我将文件夹同步到GitHub。然而,当我在Read the Docs网站上重建文档时,我在cat source/conf.py
:之后出现了这样的错误
AssertionError: wrong color format 'var(--jp-mirror-editor-variable-color)'
我只是在文档中添加了一些文本并修复了一些拼写错误,仅此而已。为什么会出现此错误并且生成失败?谢谢
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 303, in build_main
args.tags, args.verbosity, args.jobs, args.keep_going)
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 228, in __init__
self.setup_extension(extension)
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 449, in setup_extension
self.registry.load_extension(self, extname)
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/sphinx/registry.py", line 472, in load_extension
mod = __import__(extname, None, None, ['setup'])
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/nbsphinx.py", line 41, in <module>
import nbconvert
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/nbconvert/__init__.py", line 4, in <module>
from .exporters import *
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/nbconvert/exporters/__init__.py", line 4, in <module>
from .slides import SlidesExporter
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/nbconvert/exporters/slides.py", line 12, in <module>
from ..preprocessors.base import Preprocessor
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/nbconvert/preprocessors/__init__.py", line 7, in <module>
from .csshtmlheader import CSSHTMLHeaderPreprocessor
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/nbconvert/preprocessors/csshtmlheader.py", line 14, in <module>
from jupyterlab_pygments import JupyterStyle
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/jupyterlab_pygments/__init__.py", line 4, in <module>
from .style import JupyterStyle
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/jupyterlab_pygments/style.py", line 10, in <module>
class JupyterStyle(Style):
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/lib/python3.7/site-packages/pygments/style.py", line 101, in __new__
ndef[0] = colorformat(styledef)
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/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)'
Exception occurred:
File "/home/docs/checkouts/readthedocs.org/user_builds/pkg_name/envs/latest/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)'
The full traceback has been saved in /tmp/sphinx-err-scp_kb7h.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
我在iPython笔记本电脑上遇到了这个问题,因为我有一个旧版本的Pygments。使用升级Pygments
pip3 install --upgrade Pygments
我也遭受了同样的痛苦。在我的情况下,由于beacause,我将笔记本更新为最新版本,并将conda本身保留为非常旧的版本,因此它可能会引起问题,但当我运行代码:pip3 install Pygments==2.6.1
时,它对我来说非常好
这似乎与正在使用的Pygments版本有关(有关详细信息,请参阅本期GitHub(,该版本需要大于2.4.1。
在我的案例中,通过要求ReadTheDocs使用Pygments==2.6.1
解决了这个问题
我也面临同样的问题。对我来说,这是通过以下步骤解决的:Python命令失败,断言错误:错误的颜色格式,基本上是通过安装nbconvert==6.0.0rc0
。感谢