arittrabag commited on
Commit
09c7953
·
verified ·
1 Parent(s): bb8d69e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -26,7 +26,11 @@ except ImportError:
26
  _playwright_flag = os.path.join(tempfile.gettempdir(), 'playwright_installed')
27
  if PLAYWRIGHT_AVAILABLE and not os.path.exists(_playwright_flag):
28
  try:
29
- subprocess.run([sys.executable, "-m", "playwright", "install", "chromium"], check=True)
 
 
 
 
30
  with open(_playwright_flag, 'w') as f:
31
  f.write('installed')
32
  print("✅ Playwright browsers installed!")
 
26
  _playwright_flag = os.path.join(tempfile.gettempdir(), 'playwright_installed')
27
  if PLAYWRIGHT_AVAILABLE and not os.path.exists(_playwright_flag):
28
  try:
29
+ # On Linux, --with-deps ensures runtime libraries are pulled where supported
30
+ cmd = [sys.executable, "-m", "playwright", "install", "chromium"]
31
+ if sys.platform.startswith('linux'):
32
+ cmd += ["--with-deps"]
33
+ subprocess.run(cmd, check=True)
34
  with open(_playwright_flag, 'w') as f:
35
  f.write('installed')
36
  print("✅ Playwright browsers installed!")