Spaces:
Sleeping
Sleeping
Update start.sh
Browse files
start.sh
CHANGED
@@ -67,11 +67,33 @@ echo "Current directory contents:"
|
|
67 |
ls -la $HOME/app/
|
68 |
|
69 |
echo "Attempting to run Python script..."
|
70 |
-
|
71 |
-
|
72 |
-
echo "
|
|
|
73 |
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
fi
|
|
|
67 |
ls -la $HOME/app/
|
68 |
|
69 |
echo "Attempting to run Python script..."
|
70 |
+
echo "Testing Python installation:"
|
71 |
+
python3 --version
|
72 |
+
echo "Testing basic Python execution:"
|
73 |
+
python3 -c "print('Python works!')"
|
74 |
|
75 |
+
echo "Testing simple script execution:"
|
76 |
+
echo "print('Simple script works!')" > /tmp/test.py
|
77 |
+
python3 /tmp/test.py
|
78 |
+
|
79 |
+
echo "Now trying to run app.py without verbose output:"
|
80 |
+
timeout 30 python3 $HOME/app/app.py &
|
81 |
+
PYTHON_PID=$!
|
82 |
+
echo "Python PID: $PYTHON_PID"
|
83 |
+
|
84 |
+
# Wait and check if it's still running
|
85 |
+
sleep 5
|
86 |
+
if ps -p $PYTHON_PID > /dev/null; then
|
87 |
+
echo "Python script is still running after 5 seconds - likely hanging on import"
|
88 |
+
echo "Killing Python process..."
|
89 |
+
kill $PYTHON_PID
|
90 |
+
|
91 |
+
echo "Let's test importing modules one by one:"
|
92 |
+
python3 -c "print('Testing gradio import...'); import gradio; print('Gradio imported successfully')" || echo "Gradio import failed"
|
93 |
+
python3 -c "print('Testing requests import...'); import requests; print('Requests imported successfully')" || echo "Requests import failed"
|
94 |
+
python3 -c "print('Testing PIL import...'); from PIL import Image; print('PIL imported successfully')" || echo "PIL import failed"
|
95 |
+
else
|
96 |
+
wait $PYTHON_PID
|
97 |
+
PYTHON_EXIT_CODE=$?
|
98 |
+
echo "Python script exit code: $PYTHON_EXIT_CODE"
|
99 |
fi
|