When using lsp to inspect Python files in Windows, encounter the error: “Error: Error: ENOENT: no such file or directory, uv_spawn ‘pyright-langserver’”. #8017

Open
opened 2026-02-16 18:08:56 -05:00 by yindo · 1 comment
Owner

Originally created by @Arron196 on GitHub (Jan 30, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

(base) PS C:\Users\benja> pyright --version
pyright 1.1.408
(base) PS C:\Users\benja> pyright-langserver --stdio
Content-Length: 119

{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Pyright language server 1.1.408 starting"}}Content-Length: 172

{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server root directory: file:///c%3A/Users/benja/AppData/Roaming/npm/node_modules/pyright/dist"}}

I've already installed it globally via npm and added it to the environment variables, but it seems OpenCode is using its built-in LSP to execute.

Image

I've tried numerous methods, but none have worked. I've searched extensively online, yet no definitive solution has been provided.

This issue does not occur in WSL or macOS.

Plugins

"oh-my-opencode@latest", "opencode-antigravity-auth", "opencode-openai-codex-auth", "./opencode-anthropic-auth-proxy.mjs", "@tarquinen/opencode-dcp@latest"

OpenCode version

v1.1.41

Steps to reproduce

open a Python project and execute the lsp_diagnostics

Screenshot and/or share link

https://opncd.ai/share/gph2eSJQ

Operating System

Windows 11

Terminal

Windows terminal

Originally created by @Arron196 on GitHub (Jan 30, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description ```bash (base) PS C:\Users\benja> pyright --version pyright 1.1.408 (base) PS C:\Users\benja> pyright-langserver --stdio Content-Length: 119 {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Pyright language server 1.1.408 starting"}}Content-Length: 172 {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"Server root directory: file:///c%3A/Users/benja/AppData/Roaming/npm/node_modules/pyright/dist"}} ``` I've already installed it globally via npm and added it to the environment variables, but it seems OpenCode is using its built-in LSP to execute. <img width="937" height="68" alt="Image" src="https://github.com/user-attachments/assets/13a14e70-9a7b-455b-9634-a3dd11038299" /> I've tried numerous methods, but none have worked. I've searched extensively online, yet no definitive solution has been provided. This issue does not occur in WSL or macOS. ### Plugins "oh-my-opencode@latest", "opencode-antigravity-auth", "opencode-openai-codex-auth", "./opencode-anthropic-auth-proxy.mjs", "@tarquinen/opencode-dcp@latest" ### OpenCode version v1.1.41 ### Steps to reproduce open a Python project and execute the lsp_diagnostics ### Screenshot and/or share link https://opncd.ai/share/gph2eSJQ ### Operating System Windows 11 ### Terminal Windows terminal
yindo added the windowsbug labels 2026-02-16 18:08:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 30, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #11045: LSP fails on Windows due to path mismatch errors - also involves LSP failures on Windows
  • #6861: Dart LSP fails on Windows: 'Command not found' despite dart being in PATH - similar Windows spawn issue with LSP commands
  • #10642: Windows 11, opencode can not use csharp lsp - another Windows 11 LSP command execution issue
  • #3389: no such file or directory, uv_spawn error - similar ENOENT/uv_spawn error on Windows

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 30, 2026): This issue might be a duplicate of existing issues. Please check: - #11045: LSP fails on Windows due to path mismatch errors - also involves LSP failures on Windows - #6861: Dart LSP fails on Windows: 'Command not found' despite dart being in PATH - similar Windows spawn issue with LSP commands - #10642: Windows 11, opencode can not use csharp lsp - another Windows 11 LSP command execution issue - #3389: no such file or directory, uv_spawn error - similar ENOENT/uv_spawn error on Windows Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8017