.. _installation: Installation ============ Metatensor is available for multiple programming languages, and how to install and use it will depend on the programming language you are using. .. tab-set:: .. tab-item:: Python :name: install-python Metatensor is split into multiple Python packages, each providing a subset of the functionality in a modular way. Most users will want to install all the packages, but installing individual packages is also supported. The simplest way to install metatensor is to use `pip`_, and run the following commands: .. code-block:: bash # Make sure you are using the latest version of pip pip install --upgrade pip pip install metatensor This will install the ``metatensor`` package, as well as ``metatensor-core``, ``metatensor-operations`` and ``metatensor-learn``. We provide pre-built version of ``metatensor-core`` for Linux (x64), Windows (x64) and macOS (x64 and ARM64). The other packages are pure Python package that should install on any operating system. You can install any of these sub-packages one by one with .. code-block:: bash pip install metatensor-core pip install metatensor-operations pip install metatensor-learn **TorchScript integration**: If you also want to use the TorchScript bindings to metatensor, use this instead (see :ref:`this page ` for more information). .. code-block:: bash pip install metatensor[torch] .. tab-item:: C and C++ :name: install-c The main classes of metatensor are available from C and C++, and can be installed as a C-compatible shared library, with a C++ header wrapping the C library with a modern C++ API. The installation also comes with the required files for `CMake`_ integration, allowing you to use metatensor in your own CMake project with ``find_package(metatensor)``. To build and install the code, you'll need to find the latest release of ``metatensor-core`` on `GitHub releases `_, and download the corresponding ``metatensor-core-cxx`` file in the release assets. You will also need to install a Rust compiler and ``cargo`` either with `rustup`_ or the package manager of your operating system. Then, you can run the following commands: .. code-block:: bash cmake -E tar xf metatensor-core-cxx-*.tar.gz cd metatensor-core-cxx-* mkdir build && cd build # configure cmake here if needed cmake .. # build and install the code cmake --build . --target install The build and installation can be configures with a few CMake options, using ``-D