I am new to both Python and Sphinx and am attempting to autodoc python files located in a directory structured similar to the following:
Project
├── Sphinx
| ├── index.rst
| ├── autodoc.rst
| └── conf.py
├── Scripts
| ├── file1.py
| └── file2.py
| ├── folder
| | └── file3.py
My conf.py file contains:
sys.path.insert(0, os.path.abspath("../Scripts/"))
And autodoc contains:
.. automodule:: file1
:members:
.. automodule:: file2
:members:
.. automodule:: folder.file3
:members:
File3.py is not autodoc'ing correctly (Error: No module named metric.billpay)
I've also tried:
.. automodule:: folder/file3
:members:
But I receive
WARNING: invalid signature for automodule (u'folder/file3')
WARNING: don't know which module to import for autodocumenting u'folder/file3' (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)
Does anyone know how to fix this? I am new to Python, Sphinx, and StackOverflow, so my apologies if there are problems with this question.
In addition too:
sys.path.insert(0, os.path.abspath("..Scripts/"))
I added this afterward:
sys.path.insert(0, os.path.abspath("..Scripts/Folder/"))
Which allowed me to access files in Folder with autodoc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With