The 'ruamel.yaml' distribution was not found and is required by monty

I have installed Amset in my $HOME on AllianceCanada. When I run

amset run -h

Amset cannot find ruamel.yaml. When I try “pip3 install ruamel-yaml, I get the following:

Requirement already satisfied: ruamel-yaml in /home/vaskarpo/.local/lib/python3.11/site-packages (0.19.1+computecanada). There is another post that suggests upgrading pymatgen. I did that but still get the same error.

Does anyone know how I can get Amset to see ruamel.yaml?

Thanks,

Vahid

I tried using a virtual environment to install amset. The installation finished successfully but this time, “amset run -h” gave the following error:

from spglib import spglib

ImportError: cannot import name ‘spglib’ from ‘spglib’ (/home/vaskarpo/bin/amset/lib/python3.11/site-packages/spglib/init.py)

Is there a way to resolve this error?

Thanks,

Vahid

I resolved the issue by replacing “from spglib import spglib” in kpoints.py in the electronic_structure folder with the following:

from spglib import spg

In the spglib folder, we have spg.py and importing spg instead of spglib resolved the issue.

Vahid

Although the above issue (which might be a bug) was resolved and I can run amset, it crashes at the following stage:

Generating tetrahedron mesh vertices

The error is:

File "/home/vaskarpo/bin/amset/lib/python3.11/site-

packages/amset/electronic_structure/kpoints.py", line 127, in
get_kpoints_tetrahedral
grid_mapping, grid_address = spglib.get_ir_reciprocal_mesh(
^^^^^^
NameError: name ‘spglib’ is not defined

I guess this is related to my changing spglib to spg. Is there another workaround so that the code recognizes spglib?

Thanks,

Vahid

I finally got the code to run but I had to make some changes to the code.

  1. The last error was resolved by importing get_ir_reciprocal_mesh from spglib and then the “grid address=get_ir_reciprocal_mesh”
  2. In common.py, change trapz to trapezoid
  3. In calculate.py, change np.Inf to np.inf

Hopefully, other users who might experience the same issues and cannot get any help will benefit from the above.

Vahid