-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·55 lines (45 loc) · 1.6 KB
/
setup.sh
File metadata and controls
executable file
·55 lines (45 loc) · 1.6 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
#!/bin/bash
# Knowledge Graph Extraction Setup Script
echo "🚀 Setting up Knowledge Graph Extraction environment..."
echo "=================================================="
# Check if Python 3.12+ is available
python_version=$(python3 --version 2>&1 | grep -oE '[0-9]+\.[0-9]+' | head -1)
required_version="3.12"
if ! python3 -c "import sys; exit(0 if sys.version_info >= (3,12) else 1)" 2>/dev/null; then
echo "❌ Python 3.12+ required. Current version: $python_version"
echo "Please install Python 3.12 or higher"
exit 1
fi
echo "✅ Python version: $python_version"
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
echo "✅ Virtual environment created"
else
echo "✅ Virtual environment already exists"
fi
# Activate virtual environment
echo "🔄 Activating virtual environment..."
source venv/bin/activate
# Upgrade pip
echo "📈 Upgrading pip..."
pip install --upgrade pip
# Install requirements
echo "📦 Installing dependencies..."
pip install -r requirements.txt
echo ""
echo "🎉 Setup complete!"
echo ""
echo "📋 Next steps:"
echo "1. Activate the environment: source venv/bin/activate"
echo "2. Get a Gemini API key from: https://ai.google.dev/"
echo "3. Edit .env file and add your API key"
echo "4. Run the example: python run.py"
echo ""
echo "📚 Files created:"
echo " • .env - Configuration file (add your API key here)"
echo " • requirements.txt - Python dependencies"
echo " • example_usage.py - Example script"
echo " • run.py - Quick start script"
echo ""