-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·61 lines (52 loc) · 1.96 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.96 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
#!/bin/bash
set -e
echo "🎮 Installing Agent Arcade..."
# Function to handle errors
handle_error() {
echo "❌ Error occurred in install.sh:"
echo " Line: $1"
echo " Exit code: $2"
echo "Please check the error message above and try again."
exit 1
}
# Set up error handling
trap 'handle_error ${LINENO} $?' ERR
# Check Python version
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is required but not installed."
exit 1
fi
# Check Python version is >= 3.8 and <= 3.11
python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
if [ "$(printf '%s\n' "3.8" "$python_version" | sort -V | head -n1)" != "3.8" ] || [ "$(printf '%s\n' "$python_version" "3.11" | sort -V | head -n1)" != "$python_version" ]; then
echo "❌ Python version must be between 3.8 and 3.11. Found version: $python_version"
echo "Python 3.12 has compatibility issues with some dependencies. Python 3.13 is not supported."
exit 1
fi
# Check disk space before starting
echo "🔍 Checking system requirements..."
required_space=2048 # 2GB in MB
available_space=$(df -m . | awk 'NR==2 {print $4}')
if [ "$available_space" -lt "$required_space" ]; then
echo "❌ Insufficient disk space. Required: 2GB, Available: $((available_space/1024))GB"
exit 1
fi
# Check memory
total_memory=$(sysctl -n hw.memsize 2>/dev/null || free -b | awk '/^Mem:/{print $2}')
total_memory_gb=$((total_memory/1024/1024/1024))
if [ "$total_memory_gb" -lt 4 ]; then
echo "⚠️ Warning: Less than 4GB RAM detected. Training performance may be impacted."
fi
# Check if virtual environment exists
if [ ! -d "drl-env" ]; then
echo "🔧 Creating virtual environment..."
python3 -m venv drl-env
fi
echo "✅ Virtual environment created successfully!"
echo ""
echo "Next steps:"
echo "1. Activate the virtual environment:"
echo " source drl-env/bin/activate"
echo ""
echo "2. Run the second installation script:"
echo " ./install_in_venv.sh"