ImportError: cannot import name 'Sequence' from 'collections'
时间: 2023-08-31 17:11:53 浏览: 416
回答: 这个错误是由于在导入Python模块时出现了ImportError,提示无法从collections模块中导入名称为'Sequence'的内容。\[1\]这个问题的解决方法是,从Python 3.3开始,应该从collections.abc模块中导入Sequence,而不是从collections模块中导入。\[3\]在Python 3.7中,会打印一个警告信息,而在Python 3.9中,将要求从新的导入位置导入Sequence。\[3\]因此,您可以尝试从collections.abc模块中导入Sequence来解决这个问题。
#### 引用[.reference_title]
- *1* [Python错误:ImportError: cannot import name “Mapping“ from “collections](https://blog.csdn.net/NJU_Mf/article/details/128539786)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [报错 ImportError: cannot import name ‘Sequence‘ from ‘collections](https://blog.csdn.net/weixin_41639378/article/details/126411448)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文