How to Install Sphinx

This post summarizes how to install sphinx on Windows to contribute to PyQGIS Cookbook. I’m writing this as I go, so this most likely won’t be perfect.

I used my Python 2.6 stand-alone installation (not the one in OSGeo4W).

  1. Get the Sphinx egg from
  2. If you don’t have it, install setuptools to get the easy_install script
  3. In C:\Python26\Scripts run easy_install -U sphinx
  4. Get the PyQGIS source from
  5. Create a build folder inside the QGIS-Developer-Cookbook
  6. Now you can build the Cookbook: sphinx-build "C:\Users\Anita\QGIS\QGIS-Developer-Cookbook\source" "C:\Users\Anita\QGIS\QGIS-Developer-Cookbook\build"

The build folder should now contain the Cookbook .html files.

    • underdark said:

      Hi Yves,
      I’m sorry, could you explain how makes working with Sphinx easier? Right now, I just have to execute one function from command line. Seems simple to me. Thank you!

      • Hi,
        I think this is mainly a best practice rather making things easier. Here some though about why use a script with buildout config:
        * if you are working on several documentation with different configuration, different sphinx version, you have one virtual env for each documentation and you don’t “pollute” your system.
        * if several contributors are working together, you are sure that all contributor will have the same version of sphinx and other dependancies.

        Finally I always used the MakeFile created: on Windows this is something like “make.bat html”


  1. alexbruy said:

    There is a make.bat file in PyQGIS directory, which can be used to create cookbook in HTML, PDF or any other Sphinx supported format. So there is no need to run sphinx-build manually. Just cd to cookbook folder and run “make.bat” to get help or “make.bat html” to get cookbook in HTML format.

%d bloggers like this: