# Error in building Sphinx Documentation

**URL:** <https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770>\
**Category:** User Support\
**Created:** [September 18, 2020, 1:15pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770 "2020-09-18T13:15:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [September 18, 2020, 1:15pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/1 "2020-09-18T13:15:19Z")

</div>

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

```bash
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

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

```

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [October 6, 2020, 11:13am UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/2 "2020-10-06T11:13:24Z")

</div>

@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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [October 6, 2020, 11:49am UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/3 "2020-10-06T11:49:09Z")

</div>

> [@paulromano](#):
>
> In any event, one way you can get around this is to run:
> 
> ```auto
> READTHEDOCS=True make html
> 
> ```

Everything is good except `jinja2.exceptions.TemplateNotFound` error.

```bash
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

```

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [October 6, 2020, 11:53am UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/4 "2020-10-06T11:53:47Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [October 6, 2020, 12:02pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/5 "2020-10-06T12:02:36Z")

</div>

> [@paulromano](#):
>
> Maybe try running `make clean` first to clear out any previous build files?

@paulromano Same error again and again.

> [@paulromano](#):
>
> Also, make sure you `pip install sphinx-rtd-theme` .

I have all dependency installed

```bash
sphinx-rtd-theme 0.5.0 pypi_0 pypi

```

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [October 6, 2020, 12:40pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/6 "2020-10-06T12:40:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [October 6, 2020, 1:19pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/7 "2020-10-06T13:19:08Z")

</div>

```bash
# 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?

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [October 6, 2020, 8:13pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/8 "2020-10-06T20:13:23Z")

</div>

Not sure why. In my environment, I have sphinx-numfig at version 0.1.1 (corresponding to latest version on [pypi](https://pypi.org/project/sphinx_numfig/)).

---

<div class="post-metadata">

**Author:** ![Pranto](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pranto/32/489_2.png) [@Pranto](https://openmc.discourse.group/u/Pranto)\
**Post date:** [October 7, 2020, 7:29am UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/9 "2020-10-07T07:29:18Z")

</div>

I have similar `sphinx-numfig` version installed also.

```bash
# 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.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [October 7, 2020, 12:32pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/10 "2020-10-07T12:32:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [October 14, 2020, 5:01pm UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/11 "2020-10-14T17:01:13Z")

</div>

I just submitted a [pull request](https://github.com/openmc-dev/openmc/pull/1690) that should allow the documentation to be built without any special versions of `nbconvert`.

---

<div class="post-metadata">

**Author:** ![arief.rahman](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@arief.rahman](https://openmc.discourse.group/u/arief.rahman)\
**Post date:** [June 16, 2023, 6:24am UTC](https://openmc.discourse.group/t/error-in-building-sphinx-documentation/770/12 "2023-06-16T06:24:37Z")

</div>

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.
