Using Playwright with Streamlit?

Has anyone been able to get playwright to play nicely with Streamlit? I’ve got a very simple test that’s kicking up an error message I haven’t been able to make sense of. Here’s the app, using the hello-world example from playwright’s Python documentation:

import streamlit as st
from playwright.sync_api import sync_playwright

st.write(“Starting the test…”)

with sync_playwright() as p:
browser = p.chromium.launch()
page = browser.new_page()
# st.write((page.title())

And here’s the error message:

File “c:\users\aschneiderman\anaconda3\lib\site-packages\streamlit\scriptrunner\”, line 557, in _run_script
exec(code, module.dict)
File “”, line 7, in
with sync_playwright() as p:
File “c:\users\aschneiderman\anaconda3\lib\site-packages\playwright\”, line 87, in enter
File “c:\users\aschneiderman\anaconda3\lib\site-packages\playwright\”, line 67, in greenlet_main
self._loop.run_until_complete(self._connection.run_as_sync()) this
File “c:\users\aschneiderman\anaconda3\lib\asyncio\”, line 616, in run_until_complete
return future.result()
File “c:\users\aschneiderman\anaconda3\lib\site-packages\”, line 210, in run_as_sync
File “c:\users\aschneiderman\anaconda3\lib\site-packages\”, line 219, in run
await self._transport.connect()
File “c:\users\aschneiderman\anaconda3\lib\site-packages\”, line 139, in connect
raise exc
File “c:\users\aschneiderman\anaconda3\lib\site-packages\”, line 127, in connect
self._proc = await asyncio.create_subprocess_exec(
File “c:\users\aschneiderman\anaconda3\lib\asyncio\”, line 236, in create_subprocess_exec
transport, protocol = await loop.subprocess_exec(
File “c:\users\aschneiderman\anaconda3\lib\asyncio\”, line 1630, in subprocess_exec
transport = await self._make_subprocess_transport(
File “c:\users\aschneiderman\anaconda3\lib\asyncio\”, line 491, in _make_subprocess_transport
raise NotImplementedError
Made with Streamlit

It’s choking on calling sync_playwright, so I assume it has something to do with the fact that I’m telling it to run synchronously, but I have to admit I don’t understand the wonderful world of synchronous vs asynchronous. Any thoughts on what to try? Googling didn’t produce helpful results. Thanks!