Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tools/browser_use_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,17 @@ def _blocked_url_in_code(code: str) -> Optional[str]:
def _base_subprocess_env() -> dict:
from tools.browser_tool import _build_browser_env

return _build_browser_env()
env = _build_browser_env()
# The browser-use CLI runs in its own Python environment (uv tool /
# uvx), NOT the Hermes venv. Hermes sets PYTHONPATH to its own
# site-packages (see tools/environments/local.py), and a child Python
# interpreter honors it ahead of its own site-packages — on this
# machine that made browser-use import the Hermes venv's
# pydantic_core, a CPython-3.11 binary that a 3.12 interpreter can't
# load (ModuleNotFoundError: pydantic_core._pydantic_core). Strip the
# var so the CLI resolves its own dependencies.
env.pop("PYTHONPATH", None)
return env


def _read_browser_cfg() -> dict:
Expand Down