sphinx-build fail - autodoc can't import/find module

前端 未结 8 1711
青春惊慌失措
青春惊慌失措 2020-12-04 15:17

I\'m trying to get started with Sphinx and seem to have relentless problems.

Command: docs/sphinx-quickstart

I answer all the questions and ever

8条回答
  •  旧巷少年郎
    2020-12-04 15:47

    It sounds like os.path.append() is working OK for folks, but if you follow the conf.py template, you would insert the module path to the front of sys.path using os.path.insert(0, ...), and just add an extra .

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

    If you have setup your sphinx project to use separate build and source directories, that call should instead be:

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

提交回复
热议问题