I\'m trying out downloading PyYAML and install it following the instructions here http://pyyaml.org/wiki/PyYAML
So I downloaded the ZIP package: http://pyyaml.org/downlo
You can solve the issue by reinstalling the pyyaml package after adding required dependent libraries. Following are the steps:
pip uninstall pyyaml
apt-get install libyaml-dev libpython2.7-dev
pip install pyyaml
In MacOS
the following solved the problem:
pip3 uninstall PyYaml
pip3 install PyYaml==5.2