首页 > 解决方案 > AttributeError:“值”对象在运行 sphinx-build 时没有属性“tab_width”

问题描述

运行时:

sphinx-build -M html . _build

我收到以下错误:

Running Sphinx v3.0.3
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 9 source files that are out of date
updating environment: [new config] 9 added, 0 changed, 0 removed
/home/vinzee/.pyenv/versions/3.6.14/envs/venv/lib/python3.6/site-packages/recommonmark/parser.py:75: UserWarning: Container node skipped: type=document                                                      
  warn("Container node skipped: type={0}".format(mdnode.t))
reading sources... [ 66%] api                                                                                                                                                                                      
Exception occurred:
  File "/home/vinzee/.pyenv/versions/3.6.14/envs/venv/lib/python3.6/site-packages/sphinx/ext/autodoc/__init__.py", line 440, in get_doc
    tab_width = self.directive.state.document.settings.tab_width
AttributeError: 'Values' object has no attribute 'tab_width'
The full traceback has been saved in /tmp/sphinx-err-tm3jn6xm.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!

我的版本:

Python: 3.6.14  
sphinx-build: 3.0.3

我该如何解决这个错误?

标签: pythonpython-sphinx

解决方案


固定docutils<=0.16工作。

我在Sphinx github 存储库上找到了答案。

docutils>0.16在所有版本上都发现了该错误。


推荐阅读