今天在用yaml的时候出现了下面的错误:

---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-8-e2164f893693> in <module>
1 with open(config, 'r') as f:
----> 2 params = yaml.load(f, Loader=yaml.FullLoader)

AttributeError: module 'yaml' has no attribute 'FullLoader'

解决方法

pip install --ignore-installed PyYAML

参考文献

[1].AttributeError: 'module' object has no attribute 'FullLoader'. ​​https://github.com/Yelp/elastalert/issues/2298​

[2].安装yaml报错:ERROR: Cannot uninstall 'PyYAML'.​