Issue with libblosc2 when installing dolfinx via conda v24.3.0


I am facing a strange error running dolfinx in a conda env after a fresh install due to an upgrade to conda v24.3.0 with Python 3.12.2. Install steps are:

conda create -n fenicsx
conda activate fenicsx
conda install -c conda-forge fenics-dolfinx mpich pyvista

and running the raises the following error:

(fenicsx) username@ test_fenicsx % python 
Traceback (most recent call last):
  File "/Users/username/Desktop/test_fenicsx/", line 93, in <module>
    from dolfinx import fem, io, mesh
  File "/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/", line 38, in <module>
    from dolfinx import common
  File "/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/", line 11, in <module>
    from dolfinx import cpp as _cpp
ImportError: dlopen(/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/, 0x0002): Library not loaded: @rpath/libblosc2.2.dylib
  Referenced from: <1FB3FC19-B57A-3B60-B00E-82EB3169B92A> /Users/username/anaconda3/envs/fenicsx/lib/libadios2_core.2.9.2.dylib
  Reason: tried: '/Users/username/anaconda3/envs/fenicsx/lib/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/../../../libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/lib/python3.12/site-packages/dolfinx/../../../libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/bin/../lib/libblosc2.2.dylib' (no such file), '/Users/username/anaconda3/envs/fenicsx/bin/../lib/libblosc2.2.dylib' (no such file), '/usr/local/lib/libblosc2.2.dylib' (no such file), '/usr/lib/libblosc2.2.dylib' (no such file, not in dyld cache)

Any idea how to get rid of this?



1 Like

@minrk Any idea? I’ve not seen this file missing before

I have the same issue when installing dolfinx0.7.3 with conda outside $HOME.
Did you figure out was wrong?

It always helps to include conda info and conda env export output when debugging conda installation issues.

I believe you are running into this issue.

The workaround is to add to your package list 'c-blosc2<2.14' to pin-down libblosc2 to the right version.

Confirming I had this issue with a fresh install today. I also fixed it with “mamba install ‘c-blosc2<2.14’” as described above. (conda will work in place of mamba).

The command downgraded c-blosc2 from 2.14.4 to 2.13.2 on my system (mac).

same for me, using conda I did
conda install -c conda-forge c-blosc2=2.13
with my fenicsx environment active, this downgraded the library to the compatible version

Thank you all.
Downgrading c-blosc2 to 2.13 solved our issue.
Best regards