Spaces:
Build error
Build error
Create setup.sh
Browse files
setup.sh
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
|
| 3 |
+
echo "Updating system package list..."
|
| 4 |
+
sudo apt-get update -y
|
| 5 |
+
|
| 6 |
+
echo "Installing Tesseract OCR and Poppler utilities..."
|
| 7 |
+
sudo apt-get install -y tesseract-ocr tesseract-ocr-guj poppler-utils
|
| 8 |
+
|
| 9 |
+
# Check if Python3 is installed
|
| 10 |
+
if ! command -v python3 &>/dev/null; then
|
| 11 |
+
echo "Python3 is not installed. Installing Python3..."
|
| 12 |
+
sudo apt-get install -y python3 python3-pip
|
| 13 |
+
else
|
| 14 |
+
echo "Python3 is already installed."
|
| 15 |
+
fi
|
| 16 |
+
|
| 17 |
+
# Install Python dependencies from requirements.txt
|
| 18 |
+
if [[ -f "requirements.txt" ]]; then
|
| 19 |
+
echo "Installing Python dependencies from requirements.txt..."
|
| 20 |
+
pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
else
|
| 22 |
+
echo "Error: requirements.txt file not found!"
|
| 23 |
+
exit 1
|
| 24 |
+
fi
|
| 25 |
+
|
| 26 |
+
echo "Setup complete!"
|