Skip to content

Commit d4285d1

Browse files
authored
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 package (via conda). But this puts it in the environment's bin folder. This commit checks the path for the selenium-manager executable if it isn't installed in the package's webdriver/common/<platform>/ folder. fixes #11234 and #12084 * fix linting error * use conda bin folder, rather than searching PATH * fix for tox/linting error
1 parent 5e42f66 commit d4285d1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

py/selenium/webdriver/common/selenium_manager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# under the License.
1717
import json
1818
import logging
19+
import os
1920
import subprocess
2021
import sys
2122
from pathlib import Path
@@ -53,6 +54,10 @@ def get_binary() -> Path:
5354

5455
path = Path(__file__).parent.joinpath(directory, file)
5556

57+
if not path.is_file() and os.environ["CONDA_PREFIX"]:
58+
# conda has a separate package selenium-manager, installs in bin
59+
path = Path(os.path.join(os.environ["CONDA_PREFIX"], "bin", file))
60+
logger.debug(f"Conda environment detected, using `{path}`")
5661
if not path.is_file():
5762
raise WebDriverException(f"Unable to obtain working Selenium Manager binary; {path}")
5863

0 commit comments

Comments
 (0)