DAGMC Module Not Found in Python After Docker Build with OpenMC and DAGMC Support

Hello,

I am using Docker to build and run OpenMC on a Windows 11 environment.

When building the image in the Dockerfile, I included DAGMC support with the following command:

docker build -t openmc_dagmc --build-arg build_dagmc=on .

After building the image, I checked the OpenMC version inside the Docker container using openmc -v, and it shows:

DAGMC support: yes

However, when I connect the Docker interpreter to Python and try to import dagmc, I get an error saying the dagmc module is not found. Additionally, when I check the installed modules, dagmc is not listed.

Is there a solution to this issue?

Hi there,

There is no DAGMC python module. With OpenMC, DAGMC is a software library that is used as part of the OpenMC executable.

Regards,
Paul

Hi, Paul,

Thank you for your reply.

As you said, DAGMG is not python module,
so i tried importing import cad_to_dagmc in PyCharm, I encountered the following error.

OSError: libXft.so.2: cannot open shared object file: No such file or directory

Is there a solution for this error that you’re aware of?

I’m not familiar enough with cad_to_dagmc to know what might cause this. Perhaps @Shimwell would have some insights. In general, it looks like the necessary dependencies were not installed properly.

Not seen this error myself. But I do often install extra graphics things when using docker

See this line in my CI where lots of system packages get installed

Perhaps try adding some more dependencies to the docker file either mimicking the CI or this one in particular.

sudo apt install libxft2