Skip to content

Instantly share code, notes, and snippets.

@neubig
Created May 23, 2025 17:28
Show Gist options
  • Save neubig/cd7d7e4f8e0dcb2847983cdd74713a91 to your computer and use it in GitHub Desktop.
Save neubig/cd7d7e4f8e0dcb2847983cdd74713a91 to your computer and use it in GitHub Desktop.
windows-openhands-setup.md

Running OpenHands GUI on Windows

This guide provides step-by-step instructions for running OpenHands on a Windows machine without using WSL or Docker.

Prerequisites

  1. Windows 10/11 - A modern Windows operating system
  2. PowerShell 5.1 or PowerShell 7+ - Windows PowerShell comes pre-installed on Windows 10/11, but PowerShell 7+ is recommended for better compatibility
  3. Python 3.12 - Python 3.12 is required (Python 3.14 is not supported due to pythonnet compatibility)
  4. Git - For cloning the repository and version control

Step 1: Install Required Software

  1. Install Python 3.12

    • Download Python 3.12.x from python.org
    • During installation, check "Add Python to PATH"
    • Verify installation by opening PowerShell and running:
      python --version
  2. Install Git

    • Download Git from git-scm.com
    • Use default installation options
    • Verify installation:
      git --version
  3. Install Poetry

    • Open PowerShell as Administrator and run:
      (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
    • Add Poetry to your PATH:
      $env:Path += ";$env:APPDATA\Python\Scripts"
    • Verify installation:
      poetry --version

Step 2: Clone and Set Up OpenHands

  1. Clone the Repository

    git clone https://github.com/All-Hands-AI/OpenHands.git
    cd OpenHands
  2. Install Dependencies

    poetry install

    This will install all required dependencies, including:

    • pythonnet - Required for Windows PowerShell integration
    • All other OpenHands dependencies
  3. Install Pre-commit Hooks

    poetry run make install-pre-commit-hooks

Step 3: Configure OpenHands for Windows

  1. Set Up Environment Variables

    Create a .env file in the root directory with the following content:

    OPENAI_API_KEY=your_openai_api_key_here
    

    Replace your_openai_api_key_here with your actual OpenAI API key.

  2. Configure Frontend (Optional)

    If you need to customize the frontend settings, create a .env file in the frontend directory:

    VITE_BACKEND_HOST=http://localhost:3000
    VITE_USE_TLS=false
    VITE_FRONTEND_PORT=3001
    

Step 4: Run OpenHands

  1. Start the Backend

    poetry run python -m openhands.cli.main --local-runtime

    This will start the OpenHands backend using the local runtime with PowerShell integration.

  2. Start the Frontend (in a separate PowerShell window)

    cd frontend
    npm install
    npm run dev
  3. Access the OpenHands GUI

    Open your browser and navigate to:

    http://localhost:3001
    

Limitations on Windows

When running OpenHands on Windows without WSL or Docker, be aware of the following limitations:

  1. Browser Tool Not Supported: The browser tool is not currently supported on Windows.

  2. Interactive Shell Commands: Some interactive shell commands may not work as expected. The PowerShell session implementation has limitations compared to the bash session used on Linux/macOS.

  3. Path Handling: Windows uses backslashes (\) in paths, which may require adjustments when working with code examples designed for Unix-like systems.

  4. Performance: Some operations may be slower on Windows compared to Linux/macOS.

Troubleshooting

Python Version Issues

If you encounter errors related to Python version compatibility:

  1. Ensure you're using Python 3.12.x (not 3.14+)
  2. Check that Poetry is using the correct Python version:
    poetry env info

PowerShell Issues

If you encounter PowerShell-related errors:

  1. Check your PowerShell version:

    $PSVersionTable
  2. If using Windows PowerShell 5.1, consider upgrading to PowerShell 7+ for better compatibility:

  3. Ensure PowerShell execution policy allows running scripts:

    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Dependency Installation Issues

If you encounter errors during dependency installation:

  1. Ensure you have the latest version of Poetry:

    poetry self update
  2. Try clearing Poetry's cache:

    poetry cache clear --all pypi
  3. Install dependencies with verbose output to identify specific issues:

    poetry install -v

Frontend Issues

If the frontend fails to start or connect to the backend:

  1. Ensure the backend is running and accessible
  2. Check that the frontend environment variables are correctly set
  3. Try rebuilding the frontend:
    cd frontend
    npm run build
    npm run dev

Additional Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment