You can install pip by running
sudo easy_install pip
pip install pyyaml
I usually use homebrew in this case, just install python2 and
brew install python@2
pip install pyyaml
All that should be needed to run this package is
apt install python3-yaml