I think the build is out of date with no update since 2022.
Using python 3 in Ubuntu 24.04 or Rocky 9, it just core dumps when I attempt to authenticate with it. The same code works in Ubuntu 22.04 or Rocky 8 (I think - didn't go back and recheck Rocky 8 but it was working in earlier Rocky builds).
If I build a fresh venv in Rocky 9 and import pam in the shell, I see the "No module named 'six'" error.