selenium: [๐ Bug]: Selenium manager not found via Anaconda distribution
What happened?
I tried to test new Selenium manager feature with Python 3.9.13 and Edge 107.0.1418.35 (Stable) (64bit), but the exception occurs.
The code I tried
from selenium import webdriver
driver = webdriver.Edge()
and the message is this
WebDriverException: Message: 'msedgedriver' executable needs to be in PATH. Please download from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
If I enter msedge
on the โRunโ window, Edge browser opens normally.
How can we reproduce the issue?
from selenium import webdriver
driver = webdriver.Edge()
Relevant log output
WebDriverException Traceback (most recent call last)
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)
96 try:
---> 97 path = SeleniumManager.driver_location(browser)
98 except WebDriverException as new_err:
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\selenium_manager.py in driver_location(browser)
66
---> 67 args = (str(SeleniumManager.get_binary()), "--browser", browser)
68 result = SeleniumManager.run(args)
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\selenium_manager.py in get_binary()
51 if not path.is_file():
---> 52 raise WebDriverException("Unable to obtain Selenium Manager")
53
WebDriverException: Message: Unable to obtain Selenium Manager
During handling of the above exception, another exception occurred:
WebDriverException Traceback (most recent call last)
<ipython-input-2-9e8e880ac5d1> in <cell line: 1>()
----> 1 driver = webdriver.Edge()
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\edge\webdriver.py in __init__(self, executable_path, port, options, service_args, capabilities, service_log_path, service, keep_alive, verbose)
71 service = Service(executable_path, port, service_args, service_log_path)
72
---> 73 super().__init__(
74 DesiredCapabilities.EDGE["browserName"],
75 "ms",
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\chromium\webdriver.py in __init__(self, browser_name, vendor_prefix, port, options, service_args, desired_capabilities, service_log_path, service, keep_alive)
101
102 self.service = service
--> 103 self.service.start()
104
105 try:
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)
98 except WebDriverException as new_err:
99 logger.debug("Unable to obtain driver using Selenium Manager: " + new_err.msg)
--> 100 raise err
101
102 self._start_process(path)
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)
89 """
90 try:
---> 91 self._start_process(self.path)
92 except WebDriverException as err:
93 if "executable needs to be in PATH" in err.msg:
C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\common\service.py in _start_process(self, path)
201 except OSError as err:
202 if err.errno == errno.ENOENT:
--> 203 raise WebDriverException(
204 f"'{os.path.basename(self.path)}' executable needs to be in PATH. {self.start_error_message}"
205 )
WebDriverException: Message: 'msedgedriver' executable needs to be in PATH. Please download from https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/
Operating System
Windows 10 Enterprise 22H2
Selenium version
Python 4.6.0
What are the browser(s) and version(s) where you see this issue?
Edge 107.0.1418.35 (Stable) (64bit)
What are the browser driver(s) and version(s) where you see this issue?
Selenium Manager
Are you using Selenium Grid?
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (15 by maintainers)
Commits related to this issue
- fix for conda install of selenium-manager conda doesn't seem to properly package selenium-manager, so it needs to be install as a separate package (via conda). But this puts it in the environment's b... — committed to stevetracvc/selenium by stevetracvc a year ago
- fix for conda install of selenium-manager conda doesn't seem to properly package selenium-manager, so it needs to be install as a separate package (via conda). But this puts it in the environment's b... — committed to stevetracvc/selenium by stevetracvc a year ago
- fix for conda install of selenium-manager (#12536) * fix for conda install of selenium-manager conda doesn't seem to properly package selenium-manager, so it needs to be install as a separate pac... — committed to SeleniumHQ/selenium by stevetracvc a year ago
I found a workaround. Conda has a separate library, selenium-manager, that is installed in the environmentโs bin folder. Iโll submit a PR in a few minutes
Hi, @symonk This is the output you requested.
Plus, I can see
selenium_manager.py
insideC:\ProgramData\Anaconda3\Lib\site-packages\selenium\webdriver\common
By the way, I tried same code on Windows 11 22H2, Edge 107.0.1418.35 (Stable) (64 bit), Python 3.9.13 and the same error has raised.