ModuleNotFoundError:没有名为“certifi”的模块;

发布于 2025-01-10 22:16:04 字数 1372 浏览 0 评论 0原文

我已升级到 Selenium 4.1.3,但出现了问题。

C:\Users\me\Desktop\TA\TestPlan>python TestPlan_Something.py
Traceback (most recent call last):
  File "TestPlan_Something.py", line 8, in <module>
    from TestCases.Test import Test
  File "C:\Users\me\Desktop\TA\TestPlan\TestCase\Test.py", line 56, in <module>
    from Util.WebDriverEventListener import WebDriverEventListener as Listener
  File "..\Util\WebDriverEventListener.py", line 30, in <module>
    from selenium.webdriver.support.events import AbstractEventListener
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\__init__.py", line 18, in <module>
    from .firefox.webdriver import WebDriver as Firefox  # noqa
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\firefox\webdriver.py", line 27, in <module>
    from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\remote\webdriver.py", line 39, in <module>
    from .remote_connection import RemoteConnection
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\remote\remote_connection.py", line 26, in <module>
    import certifi
ModuleNotFoundError: No module named 'certifi'

据我所知,certifi 安装在以下目录中:C:\Users\me\Desktop\TA\Python\Lib\site-packages\pip_vendor。

我不确定问题是什么。

I have upgraded to Selenium 4.1.3, and it's caused a problem.

C:\Users\me\Desktop\TA\TestPlan>python TestPlan_Something.py
Traceback (most recent call last):
  File "TestPlan_Something.py", line 8, in <module>
    from TestCases.Test import Test
  File "C:\Users\me\Desktop\TA\TestPlan\TestCase\Test.py", line 56, in <module>
    from Util.WebDriverEventListener import WebDriverEventListener as Listener
  File "..\Util\WebDriverEventListener.py", line 30, in <module>
    from selenium.webdriver.support.events import AbstractEventListener
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\__init__.py", line 18, in <module>
    from .firefox.webdriver import WebDriver as Firefox  # noqa
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\firefox\webdriver.py", line 27, in <module>
    from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\remote\webdriver.py", line 39, in <module>
    from .remote_connection import RemoteConnection
  File "C:\Users\me\Desktop\TA\Python\lib\selenium\webdriver\remote\remote_connection.py", line 26, in <module>
    import certifi
ModuleNotFoundError: No module named 'certifi'

As far as I can tell certifi is installed in the following directory: C:\Users\me\Desktop\TA\Python\Lib\site-packages\pip_vendor.

I'm not sure what the problem is.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

家住魔仙堡 2025-01-17 22:16:04

解决方案:

在文件 remote_connection.py 中,我将 sys.path.append() 替换为 sys.path.insert(0, path) 并传入文件路径字符串“...\Python\Lib\site_packages\pip\_vendor”作为路径。

Solution:

In the file remote_connection.py I replaced sys.path.append() with sys.path.insert(0, path) and passed in the filepath string "...\Python\Lib\site_packages\pip\_vendor" as path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文