Skip to content

Tips for installing ALM (Python interface) with uv instead of conda ? #335

Closed

Description

@ZKC19940412

Hi,

I’m trying to set up ALAMODE’s Python interface (ALM) in a project managed with uv rather than conda. The installation consistently fails at the compilation step. Is there a recommended way to install ALM in a uv-managed environment?

Root cause (as far as I can tell): ALM needs to compile C++ code internally against Eigen and other linear algebra libraries. In a conda environment, these dependencies (the compiler toolchain, Eigen headers, etc.) are provided by conda packages, so the build works. uv only manages Python packages from PyPI and does not provide these non-Python build dependencies, so a straightforward uv install reaches the compilation step and always fails there.

Can you provide some ideas how to resolve this issues or any plan to extend ALAMODE so it can be incorporating with uv?

Thank you so much.

Activity

  1. hrushikesh-s commented on Oct 29, 2026

    @hrushikesh-s
    Contributor

    Hi @ttadano and the ALAMODE team, congrats on the 2.0.0 release, and thanks a lot for the new Python package!
    Being able to build alm (and the experimental anphon) with pip install ./python makes things much easier than before..

    Following up on this issue, I was wondering if you might consider putting the alamode package on PyPI at some point, ideally with prebuilt wheels?

    Right now, a uv or pip install still builds the C++ code locally (a C++17 compiler with OpenMP, plus Eigen, Boost, HDF5, spglib and LAPACK, and MPI for anphon), so wheels would make it a one-line install for most users.

    It would also help us a lot in atomate2 --> PyPI packages can only depend on other PyPI packages, so with wheels we could use alm for the force constant fits and anphon for the SCPH, i.e., renormalized phonons without MD (we are discussing this in materialsproject/atomate2#1634).

    I know anphon needs MPI, which makes wheels tricky.. so even an alm-only wheel to start with would already be great.

    If it helps, I would be happy to contribute to this, e.g. setting up the wheel builds (cibuildwheel on GitHub Actions) and the PyPI upload in a PR...

    cc @JaGeo @leslie-zheng for reference..

  2. ttadano commented on Oct 30, 2026

    @ttadano
    Collaborator

    Thank you @hrushikesh-s for the suggestion of PyPI packages of alm and anphon. Yes, that is on my to-do list, and my plan was to update the existing conda package first and then work on PyPI.

    If you can help us on the PyPI port, that would be very helpful.

  3. hrushikesh-s commented on Oct 30, 2026

    @hrushikesh-s
    Contributor

    @ttadano, thanks a lot! Happy to help with this.. Here is what I have in mind, but please change anything you would prefer to be done differently:

    • build wheels on my fork with cibuildwheel for Linux and macOS (the same platforms as the conda package), with the C/C++ libraries linked in, so pip install alamode works without a compiler or conda
    • keep the same MPI support as the conda package, so anphon is built with Open MPI, and pip install alamode[openmpi] gets Open MPI from PyPI (similar to how mpi4py and the LAMMPS wheels get MPI from PyPI)
    • if it works out, also add an MPICH build, so anphon can use the system MPI on HPC machines (Cray MPICH, Intel MPI, etc.)
    • open a PR here only once the wheels pass your existing tests, and I am happy to look after the wheel builds on future releases (in case the GitHub Actions build fails..)
  4. hrushikesh-s commented on Nov 16, 2026

    @hrushikesh-s
    Contributor

    @ttadano, now that alamode has been released through pypi, I think we can close this issue as well. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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