I want to install Playwright in Dataiku

He
Hello Dataiku community,
I'm trying to use Playwright in a Python code environment on Dataiku DSS.
I added playwright
to the "Packages to install" section of my environment, and it installs correctly.
However, when I run my code, I get the following error:
rustCopierModifierBrowserType.launch: Executable doesn't exist at ~/.cache/ms-playwright/...Please run 'playwright install'
I know that on a local setup (like VS Code), after doing pip install playwright
, you also need to run playwright install
once to download the actual browsers (Chromium, Firefox, WebKit).
How can I run playwright install
inside a Dataiku code environment?
- I tried using the Resource initialization script, but it's interpreted as Python, not shell.
- I also tried launching it via
subprocess.run(...)
in Python, but it fails silently or due to permissions.
Thanks in advance!
Operating system used: Windows
Operating system used: Windows
Operating system used: Windows
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,496 Neuron
Please note the Windows version of Dataiku is provided for testing purposes and not all features may work. I would suggest to use Selenium which is known to work under Dataiku and can control Chrome via the Chrome Driver:
-
Actually, i managed to make it work with subprocess. You can write it on your ressources in order to have playwright.
import subprocess
import syssubprocess.check_call([sys.executable, "-m", "playwright", "install"])