web-ui icon indicating copy to clipboard operation
web-ui copied to clipboard

Failed to initialize Playwright browser: BrowserType.launch: Executable doesn't exist

Open jeffscottward opened this issue 11 months ago • 7 comments

Can't find Chromium browser when running agent

jeffscottward avatar Jan 26 '25 13:01 jeffscottward

I'm getting the same error when trying to run the agent with "Use Own Browser" disabled. It's trying to open Chromium 1148. The ms-playwright folder has Chromium 1155 (most recent) instead.

File "C:\Users\___\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11\LocalCache\local-packages\Python311\site-packages\playwright\_impl\_connection.py", line 528, in wrap_api_call
    raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.Error: BrowserType.launch: Executable doesn't exist at C:\Users\___\AppData\Local\ms-playwright\chromium-1148\chrome-win\chrome.exe

thiagocrd avatar Jan 26 '25 21:01 thiagocrd

Solution 5: Use a Specific Browser Channel If the issue is specific to Chromium, you can try using a different browser channel (e.g., Chrome or Microsoft Edge) by specifying it in your code: (channel="chrome")

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    # Use Chrome instead of Chromium
    browser = p.chromium.launch(channel="chrome", headless=False)
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()

that works! at least for me

YiuZer0 avatar Jan 31 '25 12:01 YiuZer0

DO this playwright install chromium instead of playwright install

Zubair2019 avatar Feb 12 '25 06:02 Zubair2019

Not working. Can anyone suggest a solution?

DO this playwright install chromium instead of playwright install

okanshuman avatar Feb 13 '25 06:02 okanshuman

exec :" playwright install chromium " is working!

xqq965 avatar Mar 19 '25 03:03 xqq965

.venv/bin/playwright install

To install same

teczt avatar Apr 04 '25 18:04 teczt

In MAC browser = await p.chromium.launch(headless=True) to browser = await p.chromium.launch(channel="chrome",headless=True) is working

hohice avatar Nov 03 '25 12:11 hohice