Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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!")
|