Why can't I run playwright in python but I can in VSCode?

I have no problem running a scraper in python with playwright and selectolax in VSCode, but haven’t figured out why I can’t run it in Replit. Any thoughts?

Traceback (most recent call last):
  File "main.py", line 141, in <module>
  File "main.py", line 77, in main
    with sync_playwright() as pw:
  File "/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/sync_api/_context_manager.py", line 88, in __enter__
  File "/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/sync_api/_context_manager.py", line 67, in greenlet_main
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 238, in run_as_sync
    await self.run()
  File "/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 247, in run
    await self._transport.connect()
  File "/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/_impl/_transport.py", line 132, in connect
    raise exc
  File "/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/_impl/_transport.py", line 120, in connect
    self._proc = await asyncio.create_subprocess_exec(
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/subprocess.py", line 218, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/base_events.py", line 1670, in subprocess_exec
    transport = await self._make_subprocess_transport(
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/unix_events.py", line 207, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/asyncio/unix_events.py", line 800, in _start
    self._proc = subprocess.Popen(
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/nix/store/hd4cc9rh83j291r5539hkf6qd8lgiikb-python3-3.10.8/lib/python3.10/subprocess.py", line 1847, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/driver/playwright.sh'
1 Like

Welcome to the community, @redpiratesea!

It would be useful if you could send a link to your Repl.


Sure thing, this was the start of it


1 Like

Hey @redpiratesea!

Thank you for reporting this. I was able to reproduce this and have sent this to the team. I will reply here on the ticket status once I have an update!

1 Like

Thanks - btw you should include the ask subdomain as a page on the main replit page. There’s a community page, a help page, and this ask forum. it’s not very easy to navigate here,

1 Like

We are working on that too!


I am encountering the same issue - any idea how to solve this?

1 Like

try after running in shell

chmod 777 /home/runner/REAgentScrapperer/venv/lib/python3.10/site-packages/playwright/driver/playwright.sh

I get this error after running the suggested command in shell:

Traceback (most recent call last):
  File "main.py", line 128, in <module>
    with sync_playwright() as playwright:
  File "/home/runner/LazyWellgroomedCygwin/venv/lib/python3.10/site-packages/playwright/sync_api/_context_manager.py", line 90, in __enter__
    playwright = self._playwright
AttributeError: 'PlaywrightContextManager' object has no attribute '_playwright'

hey, i think the problem might this
The version of the glibc library is outdated and does not meet the minimum requirement for the version used by the Playwright Python package. To resolve this issue, if we can get upgraded library of the glibc library to a newer version.

this was the error

/home/runner/play756writ/venv/lib/python3.10/site-packages/playwright/driver/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib/lib/libstdc++.so.6)
/home/runner/play756writ/venv/lib/python3.10/site-packages/playwright/driver/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib/lib/libstdc++.so.6)
/home/runner/play756writ/venv/lib/python3.10/site-packages/playwright/driver/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib/lib/libstdc++.so.6)
/home/runner/play756writ/venv/lib/python3.10/site-packages/playwright/driver/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/mdck89nsfisflwjv6xv8ydj7dj0sj2pn-gcc-11.3.0-lib/lib/libgcc_s.so.1```

Do you happen to have an update?

I don’t see any recent updates on the ticket, so I’ve prompted the team for an update!

Hey, any update on this? I’m also trying to get python + playwright to work in replit.


Any updates? waiting :confused:

I apologize for the delay on this!

There hasn’t been any updates recently. Because this has been stale for a while, I will prioritize the ticket to make sure someone takes a look!

1 Like

Thank you, looking forward to it!

I know it’s not been that long but… any update?

I’m sorry to say that we don’t have the capacity to assist with per-library support right now. As a result, we can’t move forward with your issue at this time. As soon as we can give it attention again, I’ll be sure to let you know!

1 Like

Well, do you think i can install the requirements it needs manually instead of using it?

And if i can, how would i do that?

It might be possible, though I’m not sure if any work needs to be done on our platform side to support this. Regardless, you’re free to try it out!

I would recommend looking into these articles to get started with setting up a custom Repl template: