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
- Install
pyright from npm in the workspace so that node_modules/pyright/dist/pyright-langserver.js exists under the project root.
- Set
python.analysis.diagnosticsSource to "Pyright".
- Set
python.analysis.pyrightVersion to "${workspaceFolder}/node_modules/pyright/dist/pyright-langserver.js".
- Reload VS Code / restart Pylance.
- 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:
Environment data
Description
python.analysis.pyrightVersionappears 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
pyrightfrom npm in the workspace so thatnode_modules/pyright/dist/pyright-langserver.jsexists under the project root.python.analysis.diagnosticsSourceto"Pyright".python.analysis.pyrightVersionto"${workspaceFolder}/node_modules/pyright/dist/pyright-langserver.js".Python Language Serveroutput.Expected behavior
python.analysis.pyrightVersionshould resolve${workspaceFolder}and, ideally, relative paths as well, so a workspace-localpyright-langserver.jscan be used.Actual behavior
Pylance does not resolve
${workspaceFolder}and reports the following error:From my testing,
python.analysis.pyrightVersionseems 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.jslives under the workspace'snode_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
.venvare commonly used.Supporting
${workspaceFolder}or relative paths inpython.analysis.pyrightVersionwould make this practical for team settings and checked-in workspace configuration.Related issues
This seems related in spirit to: