Unable to import webdriver with selenium

Asked 2 years ago, Updated 2 years ago, 90 views

If you run from selenium import webdriver after installing selenium, you will see the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File"/opt/anaconda3/lib/python 3.8/site-packages/selenium/webdriver/_init__.py", line 18, in <module>
    from.firefox.webdriver import WebDriver as Firefox #noqa
  File"/opt/anaconda3/lib/python 3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 36, in <module>
    from.service import Service
  File"/opt/anaconda3/lib/python 3.8/site-packages/selenium/webdriver/firefox/service.py", line 21, in <module>
    class Service (service.Service):
AttributeError: module'selenium.webdriver.common.service'has no attribute'Service'

Can someone give me a solution?
Thank you for your cooperation.

anaconda selenium-webdriver import

2022-09-30 19:50

1 Answers

Cause: How to install python modules
Workaround: If "conda install~" fails to install the module, try "conda install-conda-forge".Create and activate a new python virtual environment without any other impact.


2022-09-30 19:50

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.