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

前端 未结 8 1678
青春惊慌失措
青春惊慌失措 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('../..'))
    
    0 讨论(0)
  • 2020-12-04 15:48

    I got this same error but it was caused by a completely different reason than explained in the other answers.

    My .. automethod:: mymodule.func directive should actually have been:

    .. automethod:: mymodule::func`
    
    0 讨论(0)
提交回复
热议问题