微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

不知道要导入哪个模块尝试在文档中放置“module”或“currentmodule”指令,或给出明确的模块名称

如何解决不知道要导入哪个模块尝试在文档中放置“module”或“currentmodule”指令,或给出明确的模块名称

我是 Sphinx 的新手,我正在使用 Sphinx自动生成工具。我试图从 python 文件夹中导入一个类中的所有方法。我像这样在 conf.py 中成功设置了路径

import os
import sys

sys.path.insert(0,os.path.abspath(r'path'))

这是我的自动生成代码的样子:

.. autoclass:: nameofpythonfile
   :members: 

但是,当我尝试使用 make HTML 构建 HTML 时,它给了我这个错误

Running Sphinx v4.0.2
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: 0 added,1 changed,0 removed
reading sources... [100%] code
WARNING: don't kNow which module to import for autodocumenting 'synthesizer' (try placing a "module" or "currentmodule" directive in the document,or giving an explicit module name)
looking for Now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index
generating indices... genindex done
writing additional pages... search done
copying static files... done
copying extra files... done
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded,1 warning.

The HTML pages are in build\html.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。