Xarray: libmpi.so.40 error

Hi all,

I am using an ARE session with xp65 conda/analysis3. When I tried to read a netCDF file using xarray, I encountered an error as follows:

ImportError: libmpi.so.40: cannot open shared object file: No such file or directory

A full screenshot is attached below:

Does everyone know what happens here?

Thanks

2 Likes

I get the same error using 25.04 and 25.10 as well. @rbeucher is this related to my eariler request perhaps? [Outdated openmpi in xp65 analysis3]

Same thing suddenly happening to me too, in code which had been working perfectly. I am getting it when trying to import netCDF4:

Using modules “openmpi conda/analysis3” in the ARE setup. Happens with various kernel choices (2025.x, for all values of x I’ve tried).

Error logged with helpdesk

1 Like

Try now

^ Just ran new ARE session, still getting same error.

Issue persists (with analysis3-25.10)

It works now. Thanks!

1 Like

Sorry I am trying to fix the issue for @Michael_Barnes . I’ll be more cautious next time

The error is happening again just now

It is back - /g/data/xp65/public/apps/med_conda_scripts/analysis3-25.11.d/bin/cdo: error while loading shared libraries: libmpi.so.40: cannot open shared object file: No such file or directory

Applying Scott Wales’s fix - export LD_LIBRARY_PATH=/apps/openmpi/5.0.8/lib:/apps/openmpi/5.0.8/lib/GNU:$LD_LIBRARY_PATH - Success!!

Explaining Scott Wales’s fix. The xp65 conda environment uses a ‘local’ mpi library. The ‘fix’ adds the system mpi library to the beginning of the LD_LIBRARY_PATH allowing the programs to find ‘a’ mpi library and work again. The caveat is that the system library may be different to the ‘local’ library and may give different results

Hi @griff , where did you apply Scott Wales’ fix? It doesn’t work for me.

@rbeucher any suggestions as to how to work around this?

@JuliaN - I am on the command line - I have used
```
module use /g/data/xp65/public/modules/
module load conda/analysis3
export LD_LIBRARY_PATH=/apps/openmpi/5.0.8/lib:/apps/openmpi/5.0.8/lib/GNU:$LD_LIBRARY_PATH
```

If you are using Jupyter Notebooks, you may have to use the “Pre Script” option and place the command there. This is untested and may not work. If it does work, let us know.

Back to working without that fix, I guess it was a temporary glitch? Thanks @griff !

I tried using LD_LIBRARY_PATH=/apps/openmpi/5.0.8/lib:/apps/openmpi/5.0.8/lib/GNU in the “Environment variables“ option.

and I seem to have success