解决AttributeError: XXX instance has no attribute 'xxx'的问题(新手必备)

在学习python过程中,调用某个模块时报AttributeError: GetData instance has no attribute 'data_config',如下:

 

大概意思就是实例没有data_config属性,在网上查阅了很多资料未能解决,后来尝试把调用模块前的self去掉,报了另一个错误

意思是列表索引必须是整数,所以给变量增加属性,再次运行成功!!!

原文地址:https://www.cnblogs.com/dede0753/p/11921923.html