Skip to content

1.6.0: sphinx warning WARNING: autodoc: failed to import module 'cftime' #275

@kloczek

Description

@kloczek

I'm trying to build cftime documentation and I see that sphinx shows one warning

+ /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man
Running Sphinx v4.5.0
making output directory... done
loading intersphinx inventory from https://docs.python.org/objects.inv...
intersphinx inventory has moved: https://docs.python.org/objects.inv -> https://docs.python.org/3/objects.inv
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: [new config] 3 added, 0 changed, 0 removed
reading sources... [100%] installing
WARNING: autodoc: failed to import module 'cftime'; the following exception was raised:
No module named 'cftime'
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
writing... python-cftime.3 { installing api } done
build succeeded, 1 warning.

I've been trying to solve that by using below patch but even that does not work

--- a/docs/conf.py~     2022-03-03 14:36:00.000000000 +0000
+++ b/docs/conf.py      2022-04-15 07:55:28.662466239 +0000
@@ -12,9 +12,9 @@
 # add these directories to sys.path here. If the directory is relative to the
 # documentation root, use os.path.abspath to make it absolute, like shown here.
 #
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+import os
+import sys
+sys.path.append(os.path.abspath('../src'))


 # -- Project information -----------------------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions