-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·83 lines (71 loc) · 2.19 KB
/
setup.sh
File metadata and controls
executable file
·83 lines (71 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
# File Converter Setup Script
# This script helps set up the environment for the Jupyter Notebook to PDF Converter
echo "🚀 Jupyter Notebook to PDF Converter - Setup Script"
echo "=================================================="
echo ""
# Check Python version
echo "✓ Checking Python installation..."
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.8 or higher."
exit 1
fi
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2)
echo "✓ Python $PYTHON_VERSION found"
echo ""
# Check if venv exists
if [ -d "venv" ]; then
echo "✓ Virtual environment already exists"
else
echo "📦 Creating virtual environment..."
python3 -m venv venv
echo "✓ Virtual environment created"
fi
echo ""
echo "🔄 Activating virtual environment..."
source venv/bin/activate
echo "✓ Virtual environment activated"
echo ""
# Install/upgrade pip
echo "📦 Upgrading pip..."
pip install --upgrade pip > /dev/null 2>&1
echo "✓ pip upgraded"
echo ""
# Install requirements
echo "📦 Installing Python dependencies..."
if pip install -r requirements.txt; then
echo "✓ Python dependencies installed"
else
echo "❌ Failed to install dependencies"
exit 1
fi
echo ""
# Check for pandoc
echo "✓ Checking for pandoc..."
if ! command -v pandoc &> /dev/null; then
echo "⚠️ Pandoc is not installed (required for PDF generation)"
echo " Install with: sudo apt-get install pandoc"
echo ""
read -p "Would you like to install pandoc now? (y/n) " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo apt-get update
sudo apt-get install pandoc -y
echo "✓ Pandoc installed"
fi
else
PANDOC_VERSION=$(pandoc --version | head -1)
echo "✓ $PANDOC_VERSION found"
fi
echo ""
echo "=================================================="
echo "✅ Setup Complete!"
echo "=================================================="
echo ""
echo "Next steps:"
echo "1. Run the application: python app.py"
echo "2. Open http://localhost:5000 in your browser"
echo "3. Upload a .ipynb file and convert it to PDF"
echo ""
echo "To deactivate the virtual environment later, run: deactivate"
echo ""