Skip to content

Macro Rendering Error

File: topics/dhydro_support.md

ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to install openpyxl.

Traceback (most recent call last):
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/pandas/compat/_optional.py", line 135, in import_optional_dependency
    module = importlib.import_module(name)
  File "/opt/hostedtoolcache/Python/3.13.9/x64/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1324, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'openpyxl'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/mkdocs_macros/plugin.py", line 703, in render
    return md_template.render(**page_variables)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/jinja2/environment.py", line 1295, in render
    self.environment.handle_exception()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/jinja2/environment.py", line 942, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 14, in top-level template code
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/mkdocs_table_reader_plugin/readers.py", line 60, in __call__
    return self.func(valid_file_paths[0], *args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/mkdocs_table_reader_plugin/readers.py", line 128, in read_excel
    df = pd.read_excel(*args, **read_kwargs)
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/pandas/io/excel/_base.py", line 495, in read_excel
    io = ExcelFile(
        io,
    ...<2 lines>...
        engine_kwargs=engine_kwargs,
    )
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/pandas/io/excel/_base.py", line 1567, in __init__
    self._reader = self._engines[engine](
                   ~~~~~~~~~~~~~~~~~~~~~^
        self._io,
        ^^^^^^^^^
        storage_options=storage_options,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        engine_kwargs=engine_kwargs,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/pandas/io/excel/_openpyxl.py", line 552, in __init__
    import_optional_dependency("openpyxl")
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/home/runner/work/HYDROLIB-core/HYDROLIB-core/.venv/lib/python3.13/site-packages/pandas/compat/_optional.py", line 138, in import_optional_dependency
    raise ImportError(msg)
ImportError: Missing optional dependency 'openpyxl'.  Use pip or conda to install openpyxl.