{"record":{"id":"e52f1194bb7ddbdb","repo":"SeleniumHQ/selenium","slug":"se-manager-path-does-not-point-to-a-file-env-pat","errorCode":null,"errorMessage":"SE_MANAGER_PATH does not point to a file: {env_path}","messagePattern":"SE_MANAGER_PATH does not point to a file: (.+?)","errorType":"exception","errorClass":"WebDriverException","httpStatus":null,"severity":"error","filePath":"py/selenium/webdriver/common/selenium_manager.py","lineNumber":85,"sourceCode":"\n        Returns:\n            The Selenium Manager executable location.\n\n        Raises:\n            WebDriverException: If the platform is unsupported or Selenium Manager executable can't be found.\n        \"\"\"\n        compiled_path = Path(__file__).parent.joinpath(\"selenium-manager\")\n        exe = sysconfig.get_config_var(\"EXE\")\n        if exe is not None:\n            compiled_path = compiled_path.with_suffix(exe)\n\n        path: Path | None = None\n\n        if (env_path := os.getenv(\"SE_MANAGER_PATH\")) is not None:\n            logger.debug(f\"Selenium Manager set by env SE_MANAGER_PATH to: {env_path}\")\n            path_candidate = Path(env_path)\n            if not path_candidate.is_file():\n                raise WebDriverException(f\"SE_MANAGER_PATH does not point to a file: {env_path}\")\n            path = path_candidate\n        elif compiled_path.is_file():\n            path = compiled_path\n        else:\n            allowed = {\n                (\"darwin\", \"any\"): \"macos/selenium-manager\",\n                (\"win32\", \"x86_64\"): \"windows/selenium-manager.exe\",\n                (\"cygwin\", \"x86_64\"): \"windows/selenium-manager.exe\",\n                (\"linux\", \"x86_64\"): \"linux/selenium-manager\",\n                (\"freebsd\", \"x86_64\"): \"linux/selenium-manager\",\n                (\"openbsd\", \"x86_64\"): \"linux/selenium-manager\",\n            }\n\n            # some operating systems report x86-64 architecture as amd64/AMD64\n            platform_name = sys.platform\n            arch = \"any\" if platform_name == \"darwin\" else platform.machine().lower()\n            arch = \"x86_64\" if arch == \"amd64\" else arch\n","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/SeleniumHQ/selenium/blob/aa36b38e696a0909e973bdf5e2f9031ffe842c4b/py/selenium/webdriver/common/selenium_manager.py#L67-L103","documentation":"Selenium Manager binary resolution checks the SE_MANAGER_PATH environment variable first; if set, the path must point to an existing file. If it is a directory, does not exist, or is not a regular file, WebDriverException is raised. This happens during driver startup before any browser launches.","triggerScenarios":"Setting SE_MANAGER_PATH to a directory, a path with a typo, a non-executable file path that doesn't exist, or a path on a different mount. Then constructing a WebDriver (e.g. webdriver.Chrome()) which triggers Selenium Manager.","commonSituations":"Pointing SE_MANAGER_PATH at the directory containing the binary rather than the binary itself. CI environments where the path is set but the binary isn't copied. Typo in the env var. Wrong path after a container/layout change.","solutions":["Ensure SE_MANAGER_PATH points to the executable file itself, not its directory.","Verify the file exists and is executable: `test -f \"$SE_MANAGER_PATH\" && chmod +x \"$SE_MANAGER_PATH\"`.","If unsure, unset SE_MANAGER_PATH to let Selenium use its bundled binary.","Use an absolute path to avoid working-directory issues."],"exampleFix":"# before\nexport SE_MANAGER_PATH=/opt/selenium/bin  # directory -> WebDriverException\n\n# after\nexport SE_MANAGER_PATH=/opt/selenium/bin/selenium-manager\n# or unset to use bundled binary\nunset SE_MANAGER_PATH","handlingStrategy":"validation","validationCode":"import os\nfrom pathlib import Path\np = os.getenv('SE_MANAGER_PATH')\nif p and not Path(p).is_file():\n    raise FileNotFoundError(f'SE_MANAGER_PATH is not a file: {p}; point it at the executable or unset it')","typeGuard":"from pathlib import Path\ndef se_manager_path_valid() -> bool:\n    p = os.getenv('SE_MANAGER_PATH')\n    return p is None or Path(p).is_file()","tryCatchPattern":"from selenium.common.exceptions import WebDriverException\ntry:\n    driver = webdriver.Chrome()\nexcept WebDriverException as e:\n    if 'SE_MANAGER_PATH' in str(e):\n        os.environ.pop('SE_MANAGER_PATH', None)\n        driver = webdriver.Chrome()  # retry with bundled binary","preventionTips":["Point SE_MANAGER_PATH at the executable file, not its directory.","Use an absolute path and verify the file is executable.","Unset the variable to let Selenium use its bundled binary when in doubt."],"tags":["selenium-manager","environment","binary","startup"],"backgroundTag":null,"analyzedSha":"aa36b38e696a0909e973bdf5e2f9031ffe842c4b","analyzedAt":"2026-08-14T02:32:32.244Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}