【问题标题】:How can i get attrdict module working in python?我怎样才能让 attrdict 模块在 python 中工作?
【发布时间】:2022-10-02 15:56:44
【问题描述】:

我想执行以下示例:

from attrdict import AttrDict


a = AttrDict({\'foo\': \'bar\'})
print(a.foo)

但我收到此错误: ImportError: cannot import name \'Mapping\' from \'collections\' (C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python310\\lib\ \收藏品_在里面_.py)

我该如何解决它,我觉得它就像一个错误。 当我查看这个文件时,我注意到文件中的问题,如照片所示:

(C:\\Users\\user\\AppData\\Local\\Programs\\Python\\Python310\\lib\\collections_在里面_.py) scrrenshot of ...\\collections_init_.py

    标签: python-3.x visual-studio-code


    【解决方案1】:

    AttrDict 项目因迁移到 Python 3.10 的变化而中断,但由于它在 2019 年被标记为非活动状态,因此尚未修复。

    我找到了discussion that seems to indicate that it will be reopened,但这似乎没有发生。看来我们得寻找替代品了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-25
      • 1970-01-01
      • 2021-01-22
      • 2011-04-26
      • 1970-01-01
      • 2021-09-27
      • 1970-01-01
      • 2013-07-22
      相关资源
      最近更新 更多