Quick Start
1
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:
2
Basic Agent Setup
Create a simple agent to verify installation:
3
Environment Variables Configuration
Create a Load and use environment variables:
.env file in your working directory:4
Sandbox on Windows
Agent(sandbox=True) runs on Windows out of the box using the subprocess backend, but with weaker isolation than POSIX — for untrusted code, use docker or a cloud backend.- ✅
../and absolute-path traversal protection is fully enforced - ✅ Static code safety pre-checks (
check_code_safety) run normally - ❌
setrlimitmemory / process / file-descriptor limits are not enforced - ❌ Process-group kill on timeout is unavailable — only the leader is killed
- ⚠️ Symlink escape protection only triggers when symlink creation is permitted (Developer Mode /
SeCreateSymbolicLinkPrivilege)
/docs/features/sandbox#resource-limits-in-practice for the full capability matrix.To harden a Windows sandbox, switch backends — see Sandbox Backends.5
CLI Sessions on Windows
The This functionality was fixed in PR #1837. Prior releases failed with
praisonai session commands now work on Windows out of the box — sessions are persisted to %USERPROFILE%\.praison\sessions\ using msvcrt-based file locking.ModuleNotFoundError: No module named 'fcntl' on Windows when these subcommands were invoked.6
Running the MCP host on Windows
Serve your agents to Claude Desktop or Cursor over STDIO — supported on Windows, including Python 3.13:Python 3.13 is supported. Earlier See MCP STDIO Server Transport for the reliability guarantees.
praisonai-mcp releases crashed on Windows with OSError: [WinError 6] The handle is invalid; the STDIO transport now reads stdin on a dedicated thread, so it works under the ProactorEventLoop.Point your MCP client at the command:How It Works
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
Related
Skills Documentation
Learn about Windows-compatible skills and UTF-8 handling
MCP Integration
Model Context Protocol setup for Windows environments

