Skip to content

Commit f305745

Browse files
feat(setup): add native PowerShell setup script for Windows (aden-hive#746)
* feat(setup): add PowerShell setup script with venv for Windows * docs: restore PEP 668 troubleshooting section * docs: restore Alpine Linux setup section --------- Co-authored-by: hundao <[email protected]>
1 parent fc22586 commit f305745

2 files changed

Lines changed: 337 additions & 3 deletions

File tree

ENVIRONMENT_SETUP.md

Lines changed: 86 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,43 @@ This will:
2121
- Fix package compatibility issues (openai + litellm)
2222
- Verify all installations
2323

24+
## Quick Setup (Windows – PowerShell)
25+
26+
Windows users can use the native PowerShell setup script.
27+
28+
Before running the script, allow script execution for the current session:
29+
30+
```powershell
31+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
32+
```
33+
34+
Run setup from the project root:
35+
36+
```powershell
37+
./scripts/setup-python.ps1
38+
```
39+
40+
This will:
41+
42+
- Check Python version (requires 3.11+)
43+
- Create a local `.venv` virtual environment
44+
- Install the core framework package (`framework`)
45+
- Install the tools package (`aden_tools`)
46+
- Fix package compatibility issues (openai + litellm)
47+
- Verify all installations
48+
49+
After setup, activate the virtual environment:
50+
51+
```powershell
52+
.\.venv\Scripts\Activate.ps1
53+
```
54+
55+
Set `PYTHONPATH` (required in every new PowerShell session):
56+
57+
```powershell
58+
$env:PYTHONPATH="core;exports"
59+
```
60+
2461
## Alpine Linux Setup
2562

2663
If you are using Alpine Linux (e.g., inside a Docker container), you must install system dependencies and use a virtual environment before running the setup script:
@@ -100,6 +137,12 @@ For running agents with real LLMs:
100137
export ANTHROPIC_API_KEY="your-key-here"
101138
```
102139

140+
Windows (PowerShell):
141+
142+
```powershell
143+
$env:ANTHROPIC_API_KEY="your-key-here"
144+
```
145+
103146
## Running Agents
104147

105148
All agent commands must be run from the project root with `PYTHONPATH` set:
@@ -109,9 +152,14 @@ All agent commands must be run from the project root with `PYTHONPATH` set:
109152
PYTHONPATH=core:exports python -m agent_name COMMAND
110153
```
111154

112-
### Example Commands
155+
Windows (PowerShell):
113156

114-
After building an agent via `/building-agents-construction`, use these commands:
157+
```powershell
158+
$env:PYTHONPATH="core;exports"
159+
python -m agent_name COMMAND
160+
```
161+
162+
### Example: Support Ticket Agent
115163

116164
```bash
117165
# Validate agent structure
@@ -248,6 +296,14 @@ source .venv/bin/activate
248296
PYTHONPATH=core:exports python -m your_agent_name demo
249297
```
250298

299+
### PowerShell: “running scripts is disabled on this system”
300+
301+
Run once per session:
302+
303+
```powershell
304+
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
305+
```
306+
251307
### "ModuleNotFoundError: No module named 'framework'"
252308

253309
**Solution:** Install the core package:
@@ -270,6 +326,12 @@ Or run the setup script:
270326
./quickstart.sh
271327
```
272328

329+
Windows:
330+
331+
```powershell
332+
./scripts/setup-python.ps1
333+
```
334+
273335
### "ModuleNotFoundError: No module named 'openai.\_models'"
274336

275337
**Cause:** Outdated `openai` package (0.27.x) incompatible with `litellm`
@@ -284,12 +346,21 @@ pip install --upgrade "openai>=1.0.0"
284346

285347
**Cause:** Not running from project root, missing PYTHONPATH, or agent not yet created
286348

287-
**Solution:** Ensure you're in the project root directory, have built an agent, and use:
349+
**Solution:** Ensure you're in `/hive/` and use:
350+
351+
Linux/macOS:
288352

289353
```bash
290354
PYTHONPATH=core:exports python -m your_agent_name validate
291355
```
292356

357+
Windows:
358+
359+
```powershell
360+
$env:PYTHONPATH="core;exports"
361+
python -m support_ticket_agent validate
362+
```
363+
293364
### Agent imports fail with "broken installation"
294365

295366
**Symptom:** `pip list` shows packages pointing to non-existent directories
@@ -304,6 +375,12 @@ pip uninstall -y framework tools
304375
./quickstart.sh
305376
```
306377

378+
Windows:
379+
380+
```powershell
381+
./scripts/setup-python.ps1
382+
```
383+
307384
## Package Structure
308385

309386
The Hive framework consists of three Python packages:
@@ -402,6 +479,12 @@ This design allows agents in `exports/` to be:
402479
./quickstart.sh
403480
```
404481

482+
Windows:
483+
484+
```powershell
485+
./scripts/setup-python.ps1
486+
```
487+
405488
### 2. Build Agent (Claude Code)
406489

407490
```

0 commit comments

Comments
 (0)