Python Sphinx autodoc不导入任何内容?

Python Sphinx autodoc不导入任何内容?,python,python-sphinx,autodoc,numpydoc,Python,Python Sphinx,Autodoc,Numpydoc,我试图使用sphinx(与autodoc和numpydoc)来记录我的模块,但是在基本设置之后,运行make html只生成基本的html,而不包含任何文档字符串。我正在运行Python 3.3,项目结构的概要如下: Kineticlib |--docs | |--build | |--source | | |--conf.py |--src | |--kineticmulti | | |--__init__.py | | |--file1.py | | |--file2.

我试图使用
sphinx
(与
autodoc
numpydoc
)来记录我的模块,但是在基本设置之后,运行
make html
只生成基本的html,而不包含任何文档字符串。我正在运行Python 3.3,项目结构的概要如下:

Kineticlib
|--docs
|  |--build
|  |--source
|  |  |--conf.py
|--src
|  |--kineticmulti
|  |  |--__init__.py
|  |  |--file1.py
|  |  |--file2.py
|--setup.py
\uuuu init\uuuuu.py
为空,在我添加的
docs/source
目录中的
sys.path.insert(0,os.path.abspath('....'))

docs
目录中运行
makehtml
,将得到以下输出:

sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v1.2.2
loading pickled environment... done
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.

Build finished. The HTML pages are in build/html.

那么,我做错了什么?

您是否在docs/source目录中运行了sphinx apidoc?这将生成用于生成html的.rst文件。从人类狮身人面像apidoc

sphinx-apidoc [options] -o <outputdir> <sourcedir> [pathnames ...]
sphinx-apidoc[选项]-o[路径名…]

您需要(至少)包括
outputdir
(在.rst文件所在的位置,./应该工作)和
sourcedir
,它应该指向您的包(看起来像.././src/kineticmulti应该工作)

,正如人们所说的,您应该做:

sphinx-apidoc [options] -o <outputdir> <sourcedir> [pathnames ...]
sphinx-apidoc[选项]-o[路径名…]

有时还需要修改conf.py以导入一些源模块。以及向类中添加一些文档以加载其方法文档(仅对私有类是如此,但我一直坚持这样做)。

是的,我忘了这么做。