1# pip install pyyaml
2
3import yaml
4
5with open('data.yaml') as f:
6 docs = yaml.load_all(f, Loader=yaml.FullLoader)
7 for doc in docs:
8 for k, v in doc.items():
9 print(k, "->", v)
1# Issue - AttributeError: module 'yaml' has no attribute 'load_all'
2One possible reason, you may have accidentally created a yaml.py file or yaml.py file exists there already. In such scenario, it won't be referring to python library for yaml.