I am seeing the following error:
Traceback (most recent call last):
File "generateLDA.py", line 14, in <module>
config = yaml.load(fp, Loader = yaml.FullLoader)
AttributeError: module 'yaml' has no attribute 'FullLoader'
The FullLoader
class is only available in PyYAML 5.1 and later. Version 5.1 was released on March 13, 2019 and has probably not filtered down to many distributions yet.
You can check the version of PyYAML by inspecting yaml.__version__
:
Python 2.7.15 (default, Oct 15 2018, 15:24:06)
[GCC 8.1.1 20180712 (Red Hat 8.1.1-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yaml
>>> yaml.__version__
'3.13'
If you are managing packages with pip
, you can upgrade to the current release by running:
pip install -U PyYAML
In case someone wants to use older version of yaml(3.1)
import yaml
with open('filename.yaml') as parameters:
my_dict = yaml.safe_load(parameters)
I stumbled upon it while using rospy
to run my packages.
pip install --ignore-installed PyYAML
sudo su
pip install --ignore-installed PyYAML -r requirements.txt
It worked perfectly for fail2ban-geo-exporter
Took hours to figure it out, now it runs under root & systemd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With