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

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

 

 

 

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

 

 

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

 

 

 

posted @ 2019-11-24 12:28  我想摸摸你的头  阅读(6159)  评论(0编辑  收藏  举报