-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·53 lines (43 loc) · 1.44 KB
/
setup.sh
File metadata and controls
executable file
·53 lines (43 loc) · 1.44 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
#!/bin/bash
# Exit immediately if a command exits with a non-zero status.
set -e
echo "--- Setting up English Vocabulary Learning Program ---"
# 1. Check for Python 3 and venv
if ! command -v python3 &> /dev/null
then
echo "Error: python3 could not be found. Please install Python 3."
exit 1
fi
if ! python3 -c "import ensurepip" &> /dev/null
then
echo "Warning: The 'venv' module is not installed. Attempting to install python3-venv..."
sudo apt-get update
sudo apt-get install -y python3-venv
fi
# 2. Install tkinter if not present
if ! python3 -c "import tkinter" &> /dev/null
then
echo "Info: tkinter not found. Attempting to install python3-tk..."
sudo apt-get update
sudo apt-get install -y python3-tk
fi
# 3. Install system dependencies for PyGObject and audio playback
echo "Info: Installing system dependencies for GUI and audio playback..."
sudo apt-get update
sudo apt-get install -y libcairo2-dev libgirepository1.0-dev mpg123 libxt-dev
# 4. Create a virtual environment
echo "--- Creating virtual environment in 'venv/' ---"
python3 -m venv venv
# 5. Install dependencies
echo "--- Installing dependencies from requirements.txt ---"
venv/bin/pip install -r requirements.txt
echo ""
echo "--- Setup complete! ---"
echo ""
echo "To run the application, use the following command:"
echo "source venv/bin/activate"
echo "python3 displayWord.py"
echo ""
echo "Or in one line:"
echo "./venv/bin/python displayWord.py"
echo ""