Sphinx can't locate conf.py but it is there

Viewed 1552

I am trying to execute sphinx-build, but I get this error:

(AttractoraVenv) stw041269:AttractoraProject hugovillalobos$  sphinx-build -b html source build

Application error:
config directory doesn't contain a conf.py file (source)

But, as you can see, the file is right there:

file tree

I don't know what I am missing.

1 Answers

The signature for sphinx-build is:

sphinx-build [options] <sourcedir> <outputdir> [filenames …]

Notice the rules for discovery of conf.py:

sphinx-build looks for <sourcedir>/conf.py for the configuration settings. (...)

So if you are executing sphinx-build from the /docs folder (named /documentation in your case) you would write:

sphinx-build -E -b html -d build/doctrees source build/html

C:.
├───docs <<-- Execute sphinx-build from this directory!!
│   │  
│   ├───build
│   │   ├───doctrees
│   │   └───html
│   │       ├───_sources
│   │       └───_static
│   │  
│   └───source
│       ├───_static
│       └───_templates
│
└───your_package
    └───__init__
Related