Hello
I use mule quite a bit in my ARCHER2 UM workflow but I’m struggling to get it to work properly at the moment - whenever I try to import it I get
>>> import mule
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.2 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "<stdin>", line 1, in <module>
File "/work/y07/shared/umshared/lib/python3.9/mule/__init__.py", line 1788, in <module>
from mule.ff import FieldsFile # noqa: E402
File "/work/y07/shared/umshared/lib/python3.9/mule/ff.py", line 29, in <module>
from mule.packing import wgdos_pack_field, wgdos_unpack_field
File "/work/y07/shared/umshared/lib/python3.9/mule/packing.py", line 46, in <module>
import um_packing
File "/work/y07/shared/umshared/lib/python3.9/um_packing/__init__.py", line 21, in <module>
from .um_packing import wgdos_pack, wgdos_unpack, get_shumlib_version
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
File "/work/y07/shared/umshared/lib/python3.9/mule/packing.py", line 46, in <module>
import um_packing
File "/work/y07/shared/umshared/lib/python3.9/um_packing/__init__.py", line 21, in <module>
from .um_packing import wgdos_pack, wgdos_unpack, get_shumlib_version
ImportError: numpy.core.multiarray failed to import
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/work/y07/shared/umshared/lib/python3.9/mule/__init__.py", line 1788, in <module>
from mule.ff import FieldsFile # noqa: E402
File "/work/y07/shared/umshared/lib/python3.9/mule/ff.py", line 29, in <module>
from mule.packing import wgdos_pack_field, wgdos_unpack_field
File "/work/y07/shared/umshared/lib/python3.9/mule/packing.py", line 107, in <module>
raise ImportError(err.args + (msg,))
ImportError: ('numpy.core.multiarray failed to import', 'SHUMlib Packing library found, but failed to import')
I already have . /work/y07/shared/umshared/bin/rose-um-env-puma2
in my ~/.bash_profile
as suggested in this thread and this has worked fine previously when running interactively and as part of cylc workflows and as part of normal batch scripts.
I understand there seems to be some sort of issue with module clashes with numpy 2, and I can keep trying to find a workaround, but I figured I may as well post here to let you know as this might be an issue with the central environment?
Have a good weekend all!
Fran
NB edit was because the title wasn’t very descriptive; I suppose I should add that I also tried loading the um
and postproc
modules on ARCHER2 to no avail to get mule to work.