Forums

Playwright chromium install failed.

I'm trying to install playwright using

python -m pip install playwright

which yielded success, but when I try to install the browser binary with

python -m playwright install

but I got the following:

Downloading Playwright build of chromium v907428 - 126 Mb [====================] 100% 0.0s 
Failed to install browsers
Error: Failed to download chromium v907428, caused by
Error: EIO: i/o error, write

I tried again for a few times and now the error changed to:

Removing unused browser at /home/hcaptcha/.cache/ms-playwright/chromium-907428
Downloading Playwright build of chromium v907428 - 126 Mb [====================] 100% 0.0s 
Failed to install browsers
Error: Failed to download chromium v907428, caused by
Error: ENOENT: no such file or directory, mkdir '/home/hcaptcha/.cache/ms-playwright/chromium- 
907428/chrome-linux/ClearKeyCdm/'.

I also tried install only chromium as one can do so per the documentation:

playwright install chromium

but got the same error. Any help? I'm using python 3.9.5 virtual env.

I don't think playwright will work on PythonAnywhere. We have a help page about using selenium here

I found a workaround for this, turns out pythonanywhere comes with a chromium binary preinstalled.