Add matplotlib/networkx to requirements, fix output dir and backend
Browse files- app.py +7 -0
- requirements.txt +2 -0
app.py
CHANGED
|
@@ -8,6 +8,13 @@ import sys, io, os, math, heapq, time, importlib.util
|
|
| 8 |
from contextlib import redirect_stdout
|
| 9 |
from collections import deque
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
import numpy as np
|
| 12 |
import pandas as pd
|
| 13 |
import streamlit as st
|
|
|
|
| 8 |
from contextlib import redirect_stdout
|
| 9 |
from collections import deque
|
| 10 |
|
| 11 |
+
# set non-interactive backend before any task script imports matplotlib
|
| 12 |
+
import matplotlib
|
| 13 |
+
matplotlib.use("Agg")
|
| 14 |
+
|
| 15 |
+
# ensure output folder exists (Streamlit Cloud starts fresh each deploy)
|
| 16 |
+
os.makedirs("output", exist_ok=True)
|
| 17 |
+
|
| 18 |
import numpy as np
|
| 19 |
import pandas as pd
|
| 20 |
import streamlit as st
|
requirements.txt
CHANGED
|
@@ -3,3 +3,5 @@ numpy>=2.0.0
|
|
| 3 |
pandas>=2.0.0
|
| 4 |
plotly>=5.0.0
|
| 5 |
scikit-learn>=1.3.0
|
|
|
|
|
|
|
|
|
| 3 |
pandas>=2.0.0
|
| 4 |
plotly>=5.0.0
|
| 5 |
scikit-learn>=1.3.0
|
| 6 |
+
matplotlib>=3.7.0
|
| 7 |
+
networkx>=3.0
|