Skip to content

[Windows] kimi command stuck/unable to start/unresponsive - Python 3.13 asyncio compatibility issue (official installation script installs by default) #1997

@woaye168

Description

@woaye168

Problem Description (Symptoms)

After installing Kimi CLI on a Windows system, executing the kimi command results in no response / infinite hang / stuck (hang/stuck). The process starts but produces no output, no prompt, CPU usage stays at 0%, and it must be forcibly terminated via Task Manager.

Only kimi --version returns normally, all other commands are stuck.

Common Search Terms

If you are searching for these keywords, this issue is likely what you need:

  • kimi stuck, kimi hang, kimi freeze, kimi no response
  • kimi not working, kimi process stuck, kimi cli hang
  • kimi login stuck, kimi --debug stuck, kimi interactive shell stuck

Critical: Official Installation Method Causes This Bug

The official getting-started guide at https://www.kimi.com/code/docs/kimi-cli/guides/getting-started.html recommends:

# Windows official installer script (defaults to Python 3.13)
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression

Additionally, the documentation explicitly recommends:

# For users with uv already installed (recommends Python 3.13)
uv tool install --python 3.13 kimi-cli

Both officially recommended installation methods result in a completely broken CLI on Windows, where all commands except --version hang indefinitely.

Affected Commands

  • kimi (interactive shell)
  • kimi login
  • kimi --debug
  • kimi --print
  • Any command that triggers the async event loop

Symptoms

  • Process starts but produces no output or prompt
  • Cursor may blink, but the > prompt never appears
  • CPU usage stays at 0%
  • Ctrl+C or Ctrl+D have no response
  • Must force-end via Task Manager

Root Cause

Python 3.13.12 (installed by default via uv) has a critical asyncio compatibility issue on Windows where asyncio.run() enters the event loop but never executes the coroutine.

Why does kimi --version work?

Because it uses an is_eager=True callback that exits before reaching asyncio.run(), avoiding the async event loop entirely.


Quick Verification (1 Minute Test)

If you are unsure whether you are experiencing the same issue, run these tests:

# Test 1: Check Python version
uv tool list
# If it shows kimi-cli using Python 3.13.x, this is your issue

# Test 2: Simple asyncio test
& "$env:APPDATA\uv\tools\kimi-cli\Scripts\python.exe" -c "import asyncio; asyncio.run(asyncio.sleep(0.1)); print('OK')"
# If this command also hangs, this is 100% confirmed

Solution (Verified)

Immediate Fix: Downgrade to Python 3.12

# Step 1: Uninstall the Python 3.13 version of kimi-cli
uv tool uninstall kimi-cli

# Step 2: Reinstall with Python 3.12
uv tool install --python 3.12 kimi-cli

# Step 3: Verify the fix
kimi --version          # Should show version number
kimi                    # Should show interactive Shell welcome screen
kimi login              # Should show login prompt

All commands work normally after downgrading.

Alternative: Use environment variable to bypass update check (if network is also an issue)

$env:KIMI_CLI_NO_AUTO_UPDATE = "1"
kimi

Reproduction Steps (Following Official Docs)

# Step 1: Run the official installer script (or the uv command from docs)
Invoke-RestMethod https://code.kimi.com/install.ps1 | Invoke-Expression
# Or: uv tool install --python 3.13 kimi-cli

# Step 2: Verify installation (this succeeds)
kimi --version  # Returns: kimi, version 1.37.0

# Step 3: Try using Kimi (this hangs forever)
kimi --debug    # No output, no prompt, must end via Task Manager
kimi            # Same as above
kimi login      # Same as above

Environment

Item Broken Working
OS Windows 11 -
Python 3.13.12 (default/recommended by official installer) 3.12.x
kimi-cli 1.37.0 1.37.0
uv 0.10.6 0.10.6
Terminal PowerShell / CMD PowerShell / CMD

Additional Context

  • kimi --version works because it uses the is_eager=True callback and exits before reaching asyncio.run()
  • Direct Python module execution (python -m kimi_cli) also hangs in the 3.13 environment
  • Simple asyncio.run(asyncio.sleep(0.1)) test also hangs in the 3.13 environment
  • This issue is unrelated to firewall, proxy settings, or MCP configuration - it is a Python 3.13 asyncio event loop bug

Suggested Actions

Urgent (Documentation Fix)

  • Update the getting-started documentation to explicitly recommend --python 3.12 for Windows users instead of 3.13
  • Add Python version detection and warnings to the Windows branch of the install.ps1 script

Short-Term (Installer Fix)

  • Modify install.ps1 to default to --python 3.12 on Windows
  • Or add a health check after installation that detects the asyncio hang and prompts users to downgrade

Long-Term (Root Cause Fix)

  • Investigate and fix the Python 3.13 asyncio compatibility issue on Windows (possibly related to ProactorEventLoop or SelectorEventLoop)
  • Consider adding timeout detection in code to prevent infinite hangs

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions