Error in building Sphinx Documentation

I have all dependency installed but make html from openmc/docs directory gives the following error

sphinx-build -b html -d build/doctrees   source build/html
Running Sphinx v3.2.1
making output directory... done
[autosummary] generating autosummary for: capi/index.rst, devguide/contributing.rst, devguide/docbuild.rst, devguide/docker.rst, devguide/index.rst, devguide/styleguide.rst, devguide/tests.rst, devguide/user-input.rst, devguide/workflow.rst, examples/cad-geom.rst, ..., usersguide/install.rst, usersguide/materials.rst, usersguide/parallel.rst, usersguide/plots.rst, usersguide/processing.rst, usersguide/scripts.rst, usersguide/settings.rst, usersguide/tallies.rst, usersguide/troubleshoot.rst, usersguide/volume.rst
Failed to import 'openmc.lib': no module named openmc.lib
WARNING: [autosummary] failed to import 'openmc.cmfd.CMFDMesh': no module named openmc.cmfd.CMFDMesh
WARNING: [autosummary] failed to import 'openmc.cmfd.CMFDRun': no module named openmc.cmfd.CMFDRun
WARNING: [autosummary] failed to import 'openmc.deplete.AtomNumber': no module named openmc.deplete.AtomNumber
WARNING: [autosummary] failed to import 'openmc.deplete.CECMIntegrator': no module named openmc.deplete.CECMIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.CELIIntegrator': no module named openmc.deplete.CELIIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.CF4Integrator': no module named openmc.deplete.CF4Integrator
WARNING: [autosummary] failed to import 'openmc.deplete.Chain': no module named openmc.deplete.Chain
WARNING: [autosummary] failed to import 'openmc.deplete.DecayTuple': no module named openmc.deplete.DecayTuple
WARNING: [autosummary] failed to import 'openmc.deplete.EPCRK4Integrator': no module named openmc.deplete.EPCRK4Integrator
WARNING: [autosummary] failed to import 'openmc.deplete.FissionYield': no module named openmc.deplete.FissionYield
WARNING: [autosummary] failed to import 'openmc.deplete.FissionYieldDistribution': no module named openmc.deplete.FissionYieldDistribution
WARNING: [autosummary] failed to import 'openmc.deplete.LEQIIntegrator': no module named openmc.deplete.LEQIIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.Nuclide': no module named openmc.deplete.Nuclide
WARNING: [autosummary] failed to import 'openmc.deplete.Operator': no module named openmc.deplete.Operator
WARNING: [autosummary] failed to import 'openmc.deplete.OperatorResult': no module named openmc.deplete.OperatorResult
WARNING: [autosummary] failed to import 'openmc.deplete.PredictorIntegrator': no module named openmc.deplete.PredictorIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.ReactionRates': no module named openmc.deplete.ReactionRates
WARNING: [autosummary] failed to import 'openmc.deplete.ReactionTuple': no module named openmc.deplete.ReactionTuple
WARNING: [autosummary] failed to import 'openmc.deplete.Results': no module named openmc.deplete.Results
WARNING: [autosummary] failed to import 'openmc.deplete.ResultsList': no module named openmc.deplete.ResultsList
WARNING: [autosummary] failed to import 'openmc.deplete.SICELIIntegrator': no module named openmc.deplete.SICELIIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.SILEQIIntegrator': no module named openmc.deplete.SILEQIIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.abc.DepSystemSolver': no module named openmc.deplete.abc.DepSystemSolver
WARNING: [autosummary] failed to import 'openmc.deplete.abc.EnergyHelper': no module named openmc.deplete.abc.EnergyHelper
WARNING: [autosummary] failed to import 'openmc.deplete.abc.FissionYieldHelper': no module named openmc.deplete.abc.FissionYieldHelper
WARNING: [autosummary] failed to import 'openmc.deplete.abc.Integrator': no module named openmc.deplete.abc.Integrator
WARNING: [autosummary] failed to import 'openmc.deplete.abc.ReactionRateHelper': no module named openmc.deplete.abc.ReactionRateHelper
WARNING: [autosummary] failed to import 'openmc.deplete.abc.SIIntegrator': no module named openmc.deplete.abc.SIIntegrator
WARNING: [autosummary] failed to import 'openmc.deplete.abc.TalliedFissionYieldHelper': no module named openmc.deplete.abc.TalliedFissionYieldHelper
WARNING: [autosummary] failed to import 'openmc.deplete.abc.TransportOperator': no module named openmc.deplete.abc.TransportOperator
WARNING: [autosummary] failed to import 'openmc.deplete.cram.CRAM16': no module named openmc.deplete.cram.CRAM16
WARNING: [autosummary] failed to import 'openmc.deplete.cram.CRAM48': no module named openmc.deplete.cram.CRAM48
WARNING: [autosummary] failed to import 'openmc.deplete.cram.IPFCramSolver': no module named openmc.deplete.cram.IPFCramSolver
WARNING: [autosummary] failed to import 'openmc.deplete.helpers.AveragedFissionYieldHelper': no module named openmc.deplete.helpers.AveragedFissionYieldHelper
WARNING: [autosummary] failed to import 'openmc.deplete.helpers.ChainFissionHelper': no module named openmc.deplete.helpers.ChainFissionHelper
WARNING: [autosummary] failed to import 'openmc.deplete.helpers.ConstantFissionYieldHelper': no module named openmc.deplete.helpers.ConstantFissionYieldHelper
WARNING: [autosummary] failed to import 'openmc.deplete.helpers.DirectReactionRateHelper': no module named openmc.deplete.helpers.DirectReactionRateHelper
WARNING: [autosummary] failed to import 'openmc.deplete.helpers.EnergyScoreHelper': no module named openmc.deplete.helpers.EnergyScoreHelper
WARNING: [autosummary] failed to import 'openmc.deplete.helpers.FissionYieldCutoffHelper': no module named openmc.deplete.helpers.FissionYieldCutoffHelper
WARNING: [autosummary] failed to import 'openmc.deplete.pool.deplete': no module named openmc.deplete.pool.deplete
WARNING: [autosummary] failed to import 'openmc.lib.Cell': no module named openmc.lib.Cell
WARNING: [autosummary] failed to import 'openmc.lib.EnergyFilter': no module named openmc.lib.EnergyFilter
WARNING: [autosummary] failed to import 'openmc.lib.Material': no module named openmc.lib.Material
WARNING: [autosummary] failed to import 'openmc.lib.MaterialFilter': no module named openmc.lib.MaterialFilter
WARNING: [autosummary] failed to import 'openmc.lib.MeshFilter': no module named openmc.lib.MeshFilter
WARNING: [autosummary] failed to import 'openmc.lib.MeshSurfaceFilter': no module named openmc.lib.MeshSurfaceFilter
WARNING: [autosummary] failed to import 'openmc.lib.Nuclide': no module named openmc.lib.Nuclide
WARNING: [autosummary] failed to import 'openmc.lib.RegularMesh': no module named openmc.lib.RegularMesh
WARNING: [autosummary] failed to import 'openmc.lib.Tally': no module named openmc.lib.Tally
WARNING: [autosummary] failed to import 'openmc.lib.calculate_volumes': no module named openmc.lib.calculate_volumes
WARNING: [autosummary] failed to import 'openmc.lib.finalize': no module named openmc.lib.finalize
WARNING: [autosummary] failed to import 'openmc.lib.find_cell': no module named openmc.lib.find_cell
WARNING: [autosummary] failed to import 'openmc.lib.find_material': no module named openmc.lib.find_material
WARNING: [autosummary] failed to import 'openmc.lib.hard_reset': no module named openmc.lib.hard_reset
WARNING: [autosummary] failed to import 'openmc.lib.init': no module named openmc.lib.init
WARNING: [autosummary] failed to import 'openmc.lib.iter_batches': no module named openmc.lib.iter_batches
WARNING: [autosummary] failed to import 'openmc.lib.keff': no module named openmc.lib.keff
WARNING: [autosummary] failed to import 'openmc.lib.load_nuclide': no module named openmc.lib.load_nuclide
WARNING: [autosummary] failed to import 'openmc.lib.next_batch': no module named openmc.lib.next_batch
WARNING: [autosummary] failed to import 'openmc.lib.num_realizations': no module named openmc.lib.num_realizations
WARNING: [autosummary] failed to import 'openmc.lib.plot_geometry': no module named openmc.lib.plot_geometry
WARNING: [autosummary] failed to import 'openmc.lib.reset': no module named openmc.lib.reset
WARNING: [autosummary] failed to import 'openmc.lib.run': no module named openmc.lib.run
WARNING: [autosummary] failed to import 'openmc.lib.run_in_memory': no module named openmc.lib.run_in_memory
WARNING: [autosummary] failed to import 'openmc.lib.simulation_finalize': no module named openmc.lib.simulation_finalize
WARNING: [autosummary] failed to import 'openmc.lib.simulation_init': no module named openmc.lib.simulation_init
WARNING: [autosummary] failed to import 'openmc.lib.source_bank': no module named openmc.lib.source_bank
WARNING: [autosummary] failed to import 'openmc.lib.statepoint_write': no module named openmc.lib.statepoint_write
[autosummary] generating autosummary for: /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.AzimuthalFilter.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.Cell.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.CellFilter.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.CellFromFilter.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.CellInstanceFilter.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.CellbornFilter.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.Complement.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.Cone.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.DelayedGroupFilter.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.DistribcellFilter.rst, ..., /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Normal.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Point.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.PolarAzimuthal.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Spatial.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.SphericalIndependent.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Tabular.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Uniform.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.UnitSphere.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Univariate.rst, /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/source/pythonapi/generated/openmc.stats.Watt.rst
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://numpy.org/doc/stable/objects.inv...
loading intersphinx inventory from https://docs.scipy.org/doc/scipy/reference/objects.inv...
loading intersphinx inventory from https://pandas.pydata.org/pandas-docs/stable/objects.inv...
loading intersphinx inventory from https://matplotlib.org/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 116 source files that are out of date
updating environment: [new config] 357 added, 0 changed, 0 removed
reading sources... [  2%] examples/cad-geom                                                                                                       
Exception occurred:
  File "/home/pranto/anaconda3/envs/test/lib/python3.8/site-packages/jinja2/loaders.py", line 429, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: full
The full traceback has been saved in /tmp/sphinx-err-spegijiz.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:50: recipe for target 'html' failed
make: *** [html] Error 2

I also have openmc installed

In [2]: openmc.__version__
Out[2]: '0.12.1-dev'

@Pranto What happens if you open up a Python prompt and try to import openmc.lib? If it doesn’t work, that is probably what is causing the issue when building documentation because during the setup, it tries to import that module. In any event, one way you can get around this is to run:

READTHEDOCS=True make html

We specifically check for this environment variable when building documentation so as not to try to load the libopenmc.so shared library, which is normally loaded by the openmc.lib module.

Everything is good except jinja2.exceptions.TemplateNotFound error.

reading sources... [  2%] examples/cad-geom                                                                                                       
Exception occurred:
  File "/home/pranto/anaconda3/envs/openmc12/lib/python3.8/site-packages/jinja2/loaders.py", line 429, in load
    raise TemplateNotFound(name)
jinja2.exceptions.TemplateNotFound: full
The full traceback has been saved in /tmp/sphinx-err-7_aprrjz.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Makefile:50: recipe for target 'html' failed
make: *** [html] Error 2

Never run into that error before. Maybe try running make clean first to clear out any previous build files? Also, make sure you pip install sphinx-rtd-theme.

@paulromano Same error again and again.

I have all dependency installed

sphinx-rtd-theme          0.5.0                    pypi_0    pypi

Does the traceback file in /tmp give you any useful information about the error?

#   sphinx_numfig (unknown version) from /home/pranto/anaconda3/envs/openmc12/lib/python3.8/site-packages/sphinx_numfig/__init__.py
#   notebook_sphinxext (unknown version) from /home/pranto/Desktop/2nd PR/docs/openmc-0.12.0/docs/sphinxext/notebook_sphinxext.py

Why doesn’t it print the sphinx_numfig version? Any idea @paulromano?

Not sure why. In my environment, I have sphinx-numfig at version 0.1.1 (corresponding to latest version on pypi).

I have similar sphinx-numfig version installed also.

# Name                    Version                   Build  Channel
nbsphinx                  0.7.1              pyh9f0ad1d_0    conda-forge
sphinx                    3.2.1                      py_0    conda-forge
sphinx-numfig             0.1.1                    pypi_0    pypi
sphinx-rtd-theme          0.5.0                    pypi_0    pypi
sphinxcontrib             1.0                      py38_1    anaconda
sphinxcontrib-applehelp   1.0.2                      py_0    conda-forge
sphinxcontrib-devhelp     1.0.2                      py_0    conda-forge
sphinxcontrib-htmlhelp    1.0.3                      py_0    conda-forge
sphinxcontrib-jsmath      1.0.1                      py_0    conda-forge
sphinxcontrib-katex       0.6.1                    pypi_0    pypi
sphinxcontrib-qthelp      1.0.3                      py_0    conda-forge
sphinxcontrib-serializinghtml 1.1.4                      py_0    conda-forge
sphinxcontrib-svg2pdfconverter 1.1.0                    pypi_0    pypi
sphinxcontrib-websupport  1.2.4              pyh9f0ad1d_0    conda-forge

@paulromano, Did you try on a new conda environment? The fresh installation of Anaconda still gives me the same error.

Ah, yes, now that I try in a fresh environment, I am getting the same error actually. I am currently digging into it, but it looks like a temporary fix is to downgrade the nbconvert package to version 5.6.1. Hopefully I’ll have a better solution than that soon.

I just submitted a pull request that should allow the documentation to be built without any special versions of nbconvert.

1 Like

Commenting just in case someone encounters the same issue.

I got the same error that sphinx unable to locate openmc (sorry forgot to copy the errors). This was because I installed openmc on certain dir during development and forgot to include the PATH before building the documentation.

After defining the PATH, I got additional error due to the inexistence of “pytz” package. Installing pytz with pip (conda, or etc) finally solves the issue.