-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfix.sh
More file actions
55 lines (44 loc) Β· 1.41 KB
/
fix.sh
File metadata and controls
55 lines (44 loc) Β· 1.41 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
# Fix installation with minimal dependencies
set -e
echo "π§ OpenCode Python - Installation Fix"
echo "===================================="
echo ""
cd "$(dirname "$0")"
# Check if pyproject.toml exists
if [ ! -f "pyproject.toml" ]; then
echo "β Error: pyproject.toml not found!"
echo " Please run this script from the python/ directory"
exit 1
fi
echo "π¦ Creating fresh virtual environment..."
if [ -d "venv" ]; then
echo " Removing old environment..."
rm -rf venv
fi
python3 -m venv venv 2>/dev/null || python -m venv venv
echo "π Activating virtual environment..."
source venv/bin/activate
echo "β¬οΈ Upgrading pip..."
python -m pip install --upgrade pip
echo "π₯ Installing minimal dependencies first..."
pip install -r requirements-minimal.txt
echo "π¦ Installing OpenCode (without dependencies)..."
pip install -e . --no-deps
echo ""
echo "β
Installation complete!"
echo ""
echo "Testing..."
python -c "import opencode; print('β Module imported successfully')" || echo "β οΈ Import test failed"
echo ""
echo "π― Next steps:"
echo " 1. Activate virtual environment:"
echo " source venv/bin/activate"
echo ""
echo " 2. Try the CLI:"
echo " opencode --help"
echo ""
echo " 3. Install additional features as needed:"
echo " pip install openai anthropic # For AI providers"
echo " pip install pytest black ruff # For development"
echo ""