Skip to content

environment.yaml: mace-torch upgrades NumPy to 2.x and breaks the conda-installed OpenMM (ABI mismatch) #17

Description

@luedsch

Creating the environment from environment.yaml leaves a broken install. The pip: section (via mace-torch) upgrades NumPy to 2.x after conda has installed an OpenMM that was compiled against NumPy 1.x. The log shows this explicitly:

Attempting uninstall: numpy
  Found existing installation: numpy 1.26.4
  Uninstalling numpy-1.26.4:
    Successfully uninstalled numpy-1.26.4
...
Successfully installed ... numpy-2.2.6 ...

Any subsequent import openmm.app then fails with a NumPy 1.x/2.x ABI error:

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.2.6 ...
ImportError: numpy.core.multiarray failed to import
  (in openmm/app/internal/xtc_utils/xtc.pyx while importing openmm.app)

I could workaround that error by pinning NumPy back down after the pip installs with pip install "numpy<2". Unfortunately, this caused another clash with matscipy, as shown here:

matscipy 1.2.0 requires numpy>=2.0.0, but you have numpy 1.26.4 which is incompatible

However, I am still able to pass the pytest provided in tests/test_alchemical_states.py with this workaround. Note that I had to install that package too, as this is not present in environment.yaml.


Minor / documentation note (not a bug)

On an HPC login node without a GPU driver, conda env create fails because the virtual package __cuda is absent, so the resolver refuses the CUDA PyTorch builds that sire requires. Setting CONDA_OVERRIDE_CUDA=12.6 lets the solve proceed. Maybe this saves users some time...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions