Windows SDK setup for PraisonAI with virtual environments, environment variables, and UTF-8 configurations tailored for non-developers.Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Quick Start
Python Installation & Virtual Environment
Install Python 3.10+ from python.org (recommended over Windows Store version for fewer PATH issues):If you get execution policy errors, run:
How It Works
| Component | Purpose | Windows-Specific |
|---|---|---|
| Virtual Environment | Isolate Python dependencies | Use .\.venv\Scripts\Activate.ps1 |
| Environment Variables | Store API keys securely | .env files in working directory |
| PowerShell | Command execution | Handle execution policy settings |
| UTF-8 Encoding | Prevent character issues | Save files as UTF-8 in editors |
Prerequisites
Python Installation
- Python 3.10+ from python.org (recommended)
- Avoid Windows Store Python for fewer PATH conflicts
- Git for Windows with proper line endings:
git config --global core.autocrlf true
IDE Configuration
Point your IDE to the virtual environment Python interpreter:- VS Code: Select
.venv\Scripts\python.exeas interpreter - Cursor: Use Command Palette > Python: Select Interpreter
Virtual Environment Management
PowerShell Commands
Execution Policy Issues
If activation fails with execution policy errors:Environment Variables
.env File Location
- Working Directory: Place
.envin your project root - Current Directory:
load_dotenv()reads fromos.getcwd() - Multiple Files: Use single
.envfile to avoid conflicts
Precedence and Loading
PYTHONPATH Configuration
For monorepo orsrc layouts, use session-scoped variables:
PYTHONPATH via setx as it affects other projects.
Environment Variable Security
Unicode and Encoding
File Encoding Issues
Save all Python files as UTF-8 to prevent character encoding errors:- VS Code: Check status bar, ensure “UTF-8”
- Notepad++: Encoding menu > “UTF-8”
- Windows Notepad: Save As > Encoding: UTF-8
Common Encoding Error
Python Script Encoding
Add encoding declaration to Python files:Networking and Firewall
Windows Defender Prompts
When running agents with network access:- Allow access when Windows Defender prompts
- Add exception for Python.exe in Windows Security
Port Conflicts
Check for port conflicts when running multiple agents:Localhost vs External Access
OpenClaw Integration
Subprocess Configuration
Use absolute paths for reliable subprocess execution:Virtual Environment in Subprocesses
Ensure subprocesses use the same virtual environment:Common Patterns
Development Workflow
Multi-Agent Windows Setup
Best Practices
Virtual Environment Management
Virtual Environment Management
- Always activate virtual environment before installing packages
- Use
py -3.12 -m venvinstead ofpython -m venvfor version specificity - Keep virtual environments in project directories (
.venv) - Add
.venv/to your.gitignorefile - Document Python version requirements in
README.md
Environment Variable Security
Environment Variable Security
- Use
.envfiles for development, proper secret management for production - Never commit
.envfiles to version control (add to.gitignore) - Use session-scoped variables for temporary testing
- Rotate API keys regularly and update
.envfiles - Consider using Azure Key Vault or similar for production deployments
File Encoding and Paths
File Encoding and Paths
- Always save Python files as UTF-8 encoding
- Use
pathlib.Pathfor cross-platform path handling - Use forward slashes in Python strings:
"data/file.txt" - Test with non-ASCII characters in file names and content
- Set Git to handle line endings:
git config core.autocrlf true
Networking and Firewall
Networking and Firewall
- Allow Python.exe through Windows Firewall for network features
- Use localhost (
127.0.0.1) for development, specific IPs for production - Check for port conflicts with
netstatbefore starting services - Consider Windows network profiles (Public/Private/Domain)
- Test connectivity with different antivirus software
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
'py' is not recognized | Python not in PATH | Reinstall Python, check “Add to PATH” |
Activate.ps1 cannot be loaded | Execution policy | Set-ExecutionPolicy -Scope CurrentUser RemoteSigned |
UnicodeDecodeError: 'charmap' | File not UTF-8 | Save files as UTF-8 encoding |
WinError 10048 (port in use) | Port conflict | Use netstat to find and kill process |
.env file not loading | Wrong working directory | Check os.getcwd(), move .env to correct location |
| Import errors after install | Wrong virtual environment | Verify where python points to .venv |
Related
Skills Documentation
Learn about Windows-compatible skills and UTF-8 handling
MCP Integration
Model Context Protocol setup for Windows environments

