Import ogs.callbacks gives "Import error"

I want to try to use the tespy package together with ogs, but doing so I have stumbled into a problem. Trying to run the 3D_3BHEs_array example I get an error at the “import ogs.callbacks” in the python files. Have used “pip install ogstools[ogs]” to install ogs, and in several venv using python versions ranging from 3.9-3.13, similar error every time. Anyone have a solution to this?

Typical error message is:
“import ogs.callbacks
Traceback (most recent call last):
File “”, line 1, in
import ogs.callbacks
ImportError: /home/[email protected]/work/inaventa/bhes_network/py313/lib/python3.13/site-packages/ogs/../lib64/libProcessLibBoundaryConditionAndSourceTermPython.so: undefined symbol: _ZNK10ProcessLib15ProcessVariable7getNameB5cxx11Ev”

Hi einsor.

That seems to be an error in OGS. I can reproduce it on my local machine:

$ . .venv/bin/activate
(.venv) [lehmannc@ufzleh012-ogs-dev-ctnr release]$ python 
Python 3.13.2 (main, Feb  5 2025, 08:05:21) [GCC 14.2.1 20250128] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ogs
>>> import ogs.callbacks
Traceback (most recent call last):
  File "<python-input-1>", line 1, in <module>
    import ogs.callbacks
ImportError: .../build/release/.venv/lib/python3.13/site-packages/ogs/../lib64/libProcessLibBoundaryConditionAndSourceTermPython.so: undefined symbol: _ZNK10ProcessLib15ProcessVariable7getNameB5cxx11Ev
>>> 

We are looking for a solution.

Best regards,
Christoph

For the time being a workaround could be to build OGS yourself and use that instead the one installed by pip. That should work, that configuration is used in many CI tests.

Then you’d need to import OpenGeoSys and install pip install ogstools (without [ogs]). You might give it a try, I didn’t test it explicitely.

We tried to fix the issue in !5384.
Could you test if it works for you, please?

You’ll need the latest OGS master pip to test this:

pip install --pre --index-url https://gitlab.opengeosys.org/api/v4/projects/120/packages/pypi/simple ogs

See also install via pip.

Best regards,
Christoph

Thanks, I can confirm that this works, I have some other problems with getting the example to run, but that is related more to the configuration files, not with python.