ImportError: cannot import name 'OrderedDict' from 'typing' (C:\Users\HW\AppData\Local\conda\conda\envs\python37\lib\typing.py)
时间: 2023-08-19 07:05:26 浏览: 860
ImportError: DLL load failed while importing cv2: 找不到指定的模块(亲自解决)
引用\[1\]:在使用spider时,导入大部分库时均出现ImportError: cannot import name 'Literal' from 'typing'的错误。引用\[3\]:报错:ImportError: cannot import name ‘soft_unicode’ from 'markupsafe’。引用\[2\]:前言 出现ImportError: cannot import name ‘xxx‘ from‘xxx’错误的原因有很多,本文只提供了由于库的版本导致错误的解决方案。根据这些引用内容,出现ImportError: cannot import name 'OrderedDict' from 'typing'的错误可能是由于库的版本不匹配导致的。解决方法是卸载之前安装的版本,然后安装指定版本的库。你可以尝试执行以下命令来解决这个问题:pip uninstall typing,然后pip install typing==3.7.4.3。这样应该能解决ImportError: cannot import name 'OrderedDict' from 'typing'的错误。
#### 引用[.reference_title]
- *1* [解决spider导入库出现ImportError: cannot import name ‘Literal‘ from ‘typing‘问题](https://blog.csdn.net/weixin_42590927/article/details/123318073)[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^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [解决python导包报错ImportError: cannot import name ‘xxx‘ from‘xxx’](https://blog.csdn.net/qq_40719268/article/details/130227428)[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^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [安装Superset过程中,执行‘superset db upgrade‘命令报错解决](https://blog.csdn.net/WangQueBuShiLei/article/details/125926941)[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^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文