Skip to content

python.analysis.pyrightVersion does not resolve ${workspaceFolder} or relative paths #7996

@MtkN1

Description

@MtkN1

Environment data

  • Pylance version: 2026.2.1
  • OS and version: WSL2 Ubuntu 24.04
  • Python version (& distribution if applicable, e.g. Anaconda): CPython 3.14

Description

python.analysis.pyrightVersion appears to accept only a static absolute path.

If I set it to a relative path or a path using ${workspaceFolder}, Pylance does not resolve it and instead treats the value literally.

Settings

{
    "python.analysis.diagnosticsSource": "Pyright",
    "python.analysis.pyrightVersion": "${workspaceFolder}/node_modules/pyright/dist/pyright-langserver.js",
    "python.analysis.logLevel": "Trace"
}

Repro steps

  1. Install pyright from npm in the workspace so that node_modules/pyright/dist/pyright-langserver.js exists under the project root.
  2. Set python.analysis.diagnosticsSource to "Pyright".
  3. Set python.analysis.pyrightVersion to "${workspaceFolder}/node_modules/pyright/dist/pyright-langserver.js".
  4. Reload VS Code / restart Pylance.
  5. Check the Python Language Server output.

Expected behavior

python.analysis.pyrightVersion should resolve ${workspaceFolder} and, ideally, relative paths as well, so a workspace-local pyright-langserver.js can be used.

Actual behavior

Pylance does not resolve ${workspaceFolder} and reports the following error:

2026-04-23 10:37:55.429 [info] (16583): ExternalServerController exception leak: Error: Pyright server file not found for version: ${workspaceFolder}/node_modules/pyright/dist/pyright-langserver.js

From my testing, python.analysis.pyrightVersion seems to recognize only a static absolute path. Relative paths and ${workspaceFolder} are not resolved.

Why this matters

In my project, we use the npm version of Pyright rather than the PyPI package, so pyright-langserver.js lives under the workspace's node_modules.

Because of that, I need a way to reference a workspace-local Pyright server, similar in spirit to how project-local environments such as .venv are commonly used.

Supporting ${workspaceFolder} or relative paths in python.analysis.pyrightVersion would make this practical for team settings and checked-in workspace configuration.

Related issues

This seems related in spirit to:

Metadata

Metadata

Assignees

Labels

ai-triage-respondedIndicate whether the AI triage agent has responded to this issue.fixed in next version (main)A fix has been implemented and will appear in an upcoming versionteam needs to reproduceIssue has not been reproduced yet

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions