目录
module 'yaml' has no attribute 'FullLoader'
load() missing 1 required positional argument: 'Loader'
方法3: 不改变pyyaml的版本,直接替换load()这个函数
安装方法:
pip install pyyaml -U
module 'yaml' has no attribute 'FullLoader'
临时解决方法,文末的方法也可以用:
import yaml
def load_cfg(cfg_path):
with open(cfg_path) as f_cfg:
# cfg = yaml.load(f_cfg, Loader=yaml.FullLoader)
cfg = yaml.load(f_cfg)
assert cfg is not None, 'File Not Found ' + cfg_path
return cfg