We can install the Phonopy code from the code source but it's better to install it via Conda manager as follows:

Conda is a software package management system. Once the conda system is set-up (see miniforge), the installation of phonopy is super easy for any of Linux, MacOSX, and Windows. Phonopy is installed using conda by

% conda install -c conda-forge phonopy

This phonopy’s conda package is prepared and maintained by Paweł T. Jochym at conda-forge channel (please be aware that this is not a trivial job).

Minimum steps to install and use phonopy via conda

In the following procedure, conda’s environment (see miniforge) is used not to interfere existing environment (mainly python environment).

% conda create -n phonopy -c conda-forge
% conda activate phonopy
% conda install -c conda-forge phonopy

To exit from this conda’s environment:

% conda deactivate

To use this phonopy, entering this environment is necessary like below.

% conda activate phonopy
(phonopy) % phonopy
        _
  _ __ | |__   ___  _ __   ___   _ __  _   _
 | '_ \| '_ \ / _ \| '_ \ / _ \ | '_ \| | | |
 | |_) | | | | (_) | | | | (_) || |_) | |_| |
 | .__/|_| |_|\___/|_| |_|\___(_) .__/ \__, |
 |_|                            |_|    |___/
                                      2.12.0

Python version 3.9.6
Spglib version 1.16.2


Supercell matrix (DIM or --dim) was not explicitly specified.
By this reason, phonopy_yaml mode was invoked.
But "phonopy_params.yaml", "phonopy_disp.yaml" and "phonopy.yaml" could not be found.
  ___ _ __ _ __ ___  _ __
 / _ \ '__| '__/ _ \| '__|
|  __/ |  | | | (_) | |
 \___|_|  |_|  \___/|_|

Using HDF5 on NFS mounted file system

Recent hdf5 versions just as installed may not work on NFS mounted file systems. In this case, setting the following environment variable may solve the problem:

export HDF5_USE_FILE_LOCKING=FALSE

 

Installing required packages by conda

The python libraries can be installed using conda. Conda packages are distributed in binary. Minimum setup of conda envrironment is done by miniforge, which is downloaded at conda-forge/miniforge. It is strongly recommended to create conda’s virtual environment by conda create -n <venvname> as written above. The installation of necessary libraries is done as follows:

% conda install -c conda-forge numpy scipy h5py pyyaml matplotlib-base seekpath symfc spglib

A libblas library installed can be chosen among [openblas, mkl, blis, netlib]. If specific one is expected, it is installed by (e.g. openblas)

% conda install -c conda-forge "libblas=*=*openblas"

If you need a compiler,

% conda install -c conda-forge c-compliler cxx-compiler cmake

https://phonopy.github.io/phonopy/install.html