question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"chromium" browser was not found. After successfully running install

See original GitHub issue

Steps to reproduce:

  1. Open a WSL session in vscode
  2. Create venv and install playwright 0.152.0
  3. run python -m playwright install
  4. Run the snippet with python filename.py
from playwright import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(headless=False)
    page = browser.newPage()
    page.goto('https://github.com/microsoft')
    page.screenshot(path=f'example.png')
    browser.close()
  1. See it crashes with
Traceback (most recent call last):
  File "/home/crow/code/x/.env/lib/python3.8/site-packages/playwright/browser_type.py", line 69, in launch
    return from_channel(await self._channel.send("launch", params))
  File "/home/crow/code/x/.env/lib/python3.8/site-packages/playwright/connection.py", line 39, in send
    result = await callback.future
playwright.helper.Error: Protocol error (Browser.getVersion): Target closed.
=========================== logs ===========================
<launching> /home/crow/.cache/ms-playwright/chromium-815036/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/tmp/playwright_chromiumdev_profile-N9z69q --remote-debugging-pipe --no-sandbox --no-startup-window
<launched> pid=2011
[err] [2011:2011:1030/185956.954944:ERROR:browser_main_loop.cc(1434)] Unable to open X display.
============================================================
Note: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "scheduler.py", line 4, in <module>
    browser = p.chromium.launch(headless=False)
  File "/home/crow/code/x/.env/lib/python3.8/site-packages/playwright/sync_api.py", line 6142, in launch
    self._sync(
  File "/home/crow/code/x/.env/lib/python3.8/site-packages/playwright/sync_base.py", line 107, in _sync
    return future.result()
  File "/home/crow/code/x/.env/lib/python3.8/site-packages/playwright/browser_type.py", line 72, in launch
    raise not_installed_error(f'"{self.name}" browser was not found.')
Exception: 
================================================================================
"chromium" browser was not found.
Please complete Playwright installation via running

    "python -m playwright install"

================================================================================

Extra details

Before failing with this error it prompted me to install some os dependencies which i did with sudo apt install libnss3 libnspr4

Versions

Playwright Version: 0.152.0 Windows Version: WSL: Version 2 vscode: 1.50.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
pavelfeldmancommented, Nov 21, 2020

I see what you are saying. So you’d like a mode where your project along with the tooling is in WSL, but the browser opens in the host system. Let us collect more feedback on it.

1reaction
pavelfeldmancommented, Oct 30, 2020

Oh, you can’t run headful on WSL - there is no display. (headless=False) won’t work on headless systems such as WSL.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chromium-Browser 92.0.4515.98~buster-rpt1
The 'chromium' package doesn't run on armv6, so that's not a solution. I haven't been able to reproduce the issue on my pi...
Read more >
CentOS: Unable to install Chromium browser - linux
i used your steps .its installed successfully.but after that when i run command chrome,chromium.its printing chromium is not a command. – ...
Read more >
Common Problems and Solutions
Not auto-updating will mean users are running old, and potentially vulnerable, versions of the browser. You can push a new MSI install over...
Read more >
156400 - Chrome not registered correctly anymore. Can't ...
Installing Chrome for all users on the computer should resolve it. I believe that if you uninstall Chrome and re-install dev channel from...
Read more >
Chrome Business installer fails when GoogleUpdater has ...
I finally got it to work when I gave the computer in question internet access and Chrome was installed within 1 minute. When...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found