Installing OpenClaw on Windows
Install OpenClaw AI on Windows 10 or Windows 11. Supports pip, conda, and WSL2 methods. Includes PowerShell setup and Windows Defender guidance.
Prerequisites
You need Python 3.10 or newer. Download from python.org or the Microsoft Store.
During Python installation, check "Add Python to PATH". Otherwise you must add it manually from System > Environment Variables.
# Verify Python version (PowerShell or CMD)
python --version
# Python 3.11.xMethod 1: pip (Recommended)
# Open PowerShell as regular user (not admin required)
pip install openclaw
# Verify
openclaw --versionVirtual Environment (Recommended)
# Create virtual environment
python -m venv $env:USERPROFILE\venvs\openclaw
# Activate
& "$env:USERPROFILE\venvs\openclaw\Scripts\Activate.ps1"
# Install
pip install openclaw
# Verify
openclaw --versionIf activating the venv fails with a policy error, run PowerShell as Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Method 2: Conda
conda create -n openclaw python=3.11 -y
conda activate openclaw
pip install openclaw
openclaw --versionMethod 3: WSL2 (Linux Subsystem)
WSL2 gives you a full Linux environment inside Windows and is ideal for production-grade setups:
# Enable WSL2 (run in PowerShell as Admin)
wsl --install
# After restart, open Ubuntu terminal in WSL2:
sudo apt update
sudo apt install python3-pip python3-venv
pip3 install openclaw
openclaw --versionSetting Environment Variables
Per-session (PowerShell)
$env:OPENAI_API_KEY = "sk-proj-..."
$env:OPENCLAW_PROVIDER = "openai"Persistent (Windows Registry)
[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "sk-proj-...", "User")
[Environment]::SetEnvironmentVariable("OPENCLAW_PROVIDER", "openai", "User")Using a .env file
# Create %USERPROFILE%\.openclaw\.env
OPENAI_API_KEY=sk-proj-...
OPENCLAW_PROVIDER=openai
OPENCLAW_LOG_LEVEL=infoWindows Defender Notes
Windows Defender may slow down pip installs or flag OpenClaw's CLI binary. To speed things up, add an exclusion for your virtual environment folder and the Python Scripts directory. Go to: Windows Security → Virus & threat protection → Exclusions.
Verify Your Installation
After installation, run these commands to confirm everything is working:
# Check version
openclaw --version
# OpenClaw v1.x.x
# Check configuration
openclaw config show
# provider: (not set)
# model: (not set)
# Run a simple test (requires API key)
openclaw run "Say hello in one sentence"
# Hello! How can I help you today?First Real Task
Once your API key is configured, run your first real task:
# Set your OpenAI API key
openclaw config set openai.api_key "sk-proj-..."
openclaw config set provider openai
openclaw config set openai.model gpt-4o-mini
# Run a practical task
openclaw run "List 5 things I should check after installing a new Python library"
# For offline use (with Ollama installed):
openclaw config set provider ollama
openclaw config set model llama3.2
openclaw run "What is the capital of France?"Update & Uninstall
Upgrade to the Latest Version
# Upgrade (with venv activated)
pip install --upgrade openclaw
openclaw --versionCheck for Updates Without Installing
pip index versions openclaw
# openclaw (1.x.x)
# Available versions: 1.x.x, 1.x.x-1, ...Uninstall
pip uninstall openclaw -y
# Remove config files (optional)
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw\"Automating Tasks with Windows Task Scheduler
To run OpenClaw automations on a schedule without any third-party tools, use the built-in Windows Task Scheduler:
# Create a scheduled task via PowerShell (run as Administrator)
$Action = New-ScheduledTaskAction `
-Execute "C:\Users\YourName\.venv\openclaw\Scripts\openclaw.exe" `
-Argument 'run "Daily briefing summary" --output C:\Users\YourName\briefing.txt' `
-WorkingDirectory "C:\Users\YourName\Projects"
$Trigger = New-ScheduledTaskTrigger -Daily -At "08:00"
Register-ScheduledTask `
-TaskName "OpenClaw Morning Briefing" `
-Action $Action `
-Trigger $Trigger `
-RunLevel HighestWindows PATH Troubleshooting
If you see 'openclaw' is not recognized as an internal or external command, the Scripts folder is not on your PATH:
# Find where openclaw was installed
pip show openclaw | Select-String "Location"
# The Scripts folder is at the Location path + \Scripts
# Add it to PATH permanently:
[System.Environment]::SetEnvironmentVariable(
"PATH",
"$env:PATH;C:\Users\YourName\AppData\Roaming\Python\Python312\Scripts",
[System.EnvironmentVariableTarget]::User
)
# Then restart your terminal and verify:
openclaw --versionWindows Defender / Antivirus Notes
Windows Defender may flag Python scripts or automation tools. To add an exclusion for your venv:
Add-MpPreference -ExclusionPath "C:\Users\YourName\.venv\openclaw"
Add-MpPreference -ExclusionPath "C:\Users\YourName\.openclaw"This is optional and only needed if Defender is interfering with execution.
Windows-Specific Troubleshooting
| Error | Cause | Fix |
|---|---|---|
execution policy error | PowerShell restricts script execution | Run: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser |
Microsoft Visual C++ 14.0 required | Some pip packages need compiler | Install VS Build Tools |
Filename too long during pip install | Windows 260-char path limit | Enable long paths: reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 |
UnicodeDecodeError on output | Terminal uses non-UTF-8 encoding | Run: $env:PYTHONIOENCODING="utf-8" before openclaw commands |
For more installation errors, see the Installation Errors guide.