天天看点

bunch 报错

在使用bunch包的时候免不了会包错比如:

'dict_keys' object has no attribute 'sort'
           

又比如

'dict' object has no attribute 'iteritems'
           

等等,其实这是由于bunch不适配python3造成的,一般来说这种错误都是使用python3 运行bunch的时候出现,这个时候推荐大家使用munch这个包,用法和bunch一样,但是在python3环境中可用具体可以看:

pip install munch
           

https://github.com/Infinidat/munch