Update solver.py
Browse files
solver.py
CHANGED
|
@@ -474,20 +474,22 @@ class QuizSolver:
|
|
| 474 |
|
| 475 |
if dependencies!=[]:
|
| 476 |
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
|
|
|
|
|
|
| 491 |
|
| 492 |
file_path = os.path.join(self.temp_dir.name, "script.py")
|
| 493 |
|
|
|
|
| 474 |
|
| 475 |
if dependencies!=[]:
|
| 476 |
|
| 477 |
+
try:
|
| 478 |
+
to_install=[sys.executable, "-m", "pip", "install"] + dependencies
|
| 479 |
+
|
| 480 |
+
print('Starting package installation',flush=True)
|
| 481 |
+
|
| 482 |
+
result = subprocess.run(
|
| 483 |
+
to_install,
|
| 484 |
+
check=True,
|
| 485 |
+
text=True,
|
| 486 |
+
capture_output=True
|
| 487 |
+
)
|
| 488 |
+
|
| 489 |
+
if result.returncode!=0:
|
| 490 |
+
return 100
|
| 491 |
+
except:
|
| 492 |
+
return 100
|
| 493 |
|
| 494 |
file_path = os.path.join(self.temp_dir.name, "script.py")
|
| 495 |
|