【问题标题】:undetected-chromedriver import is unsuccessful. ImportError: cannot import name 'Mapping' from 'collections'undetected-chromedriver 导入不成功。 ImportError:无法从“集合”导入名称“映射”
【发布时间】:2022-01-04 12:42:59
【问题描述】:

我尝试导入 undetected_chromedriver

import undetected-chromedriver.v2 as uc

driver = uc.Chrome()

resp = driver.get("https://google.com")

运行上述代码会引发以下错误。

File "C:\Users\Narmu\Desktop\Python_Workspace_Master\venv\lib\site-packages\undetected_chromedriver\cdp.py"

from collections import Mapping, Sequence
ImportError: cannot import name 'Mapping' from 'collections'

我搜索了关于 collections 包,但它在包列表中不可用

我找到了来自in VS Code ImportError: cannot import name 'Mapping' from 'collections'?的建议。

collections.abc 也不在包列表中。

我使用 python 版本 3.10。

要完成这项工作,请建议我。

【问题讨论】:

    标签: python python-3.x undetected-chromedriver


    【解决方案1】:

    截至 2021 年 12 月 11 日的答案:不要使用 Python 3.10。 undetected_chromedriver 包到处都有错误。

    我降级到 3.7.9,现在一切运行良好。不过你可以试试其他 Python 版本。

    【讨论】:

      猜你喜欢
      • 2022-06-22
      • 2021-11-21
      • 1970-01-01
      • 2015-11-18
      • 1970-01-01
      • 1970-01-01
      • 2016-01-16
      • 2017-08-23
      相关资源
      最近更新 更多