Fixes the [mason-lspconfig.nvim] failed to install basedpyright error that appears on every nvim startup in the dejima container.
Cause
mason installs basedpyright from PyPI, which means creating a venv for it first (mason-core/installer/managers/pypi.lua). Debian ships venv's ensurepip in a separate python3-venv package rather than with python3 itself, and the container image doesn't have it, so python3 -m venv exits 1:
$ python3 -m venv /tmp/vtest
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package [...]
exit=1
which matches the mason log exactly:
Installation failed for Package(name=basedpyright) error=spawn: python3 failed with exit code 1 and signal 0.
ruff installs fine alongside it because mason pulls that one as a prebuilt binary from a GitHub release, not from PyPI, so it never touches a venv. The Provider "pypi" "get_supported_python_versions" failed: wget failed with exit code 4 line just above it in the log is a separate, transient startup race: pypi.org, files.pythonhosted.org and api.github.com are all reachable from the container, and that provider call failing only means mason skips the Python version compatibility check, it does not fail the install.
Changes
packages/apt.global gains python3-venv, which is the actual fix. Arch already bundles ensurepip with its python package, and brew.global installs a full python, so this only affects the Debian path.
config/nvim/lua/plugins/lsp.lua now checks for venv support before adding basedpyright to ensure_installed, mirroring the has_public_npm() guard already there for the npm-sourced servers. On a machine that lacks it the user gets one warning naming the package to install, instead of a failed install on every startup. ruff is unconditional now that it is separated out, since it has no such dependency.
Testing
Reproduced the venv failure directly, then confirmed the guard drops basedpyright and leaves the rest intact:
A full startup against the branch config emits the one warning and writes no new mason install-failure entries to ~/.local/state/nvim/mason.log.
Note that the container's ~/.config/nvim is a copy baked in at image build time, not a symlink to this checkout, so the dejima image needs a rebuild to pick either change up.
**Summary generated by LLM agent**
Fixes the `[mason-lspconfig.nvim] failed to install basedpyright` error that appears on every nvim startup in the dejima container.
## Cause
mason installs `basedpyright` from PyPI, which means creating a venv for it first (`mason-core/installer/managers/pypi.lua`). Debian ships venv's `ensurepip` in a separate `python3-venv` package rather than with `python3` itself, and the container image doesn't have it, so `python3 -m venv` exits 1:
```
$ python3 -m venv /tmp/vtest
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package [...]
exit=1
```
which matches the mason log exactly:
```
Installation failed for Package(name=basedpyright) error=spawn: python3 failed with exit code 1 and signal 0.
```
`ruff` installs fine alongside it because mason pulls that one as a prebuilt binary from a GitHub release, not from PyPI, so it never touches a venv. The `Provider "pypi" "get_supported_python_versions" failed: wget failed with exit code 4` line just above it in the log is a separate, transient startup race: pypi.org, files.pythonhosted.org and api.github.com are all reachable from the container, and that provider call failing only means mason skips the Python version compatibility check, it does not fail the install.
## Changes
`packages/apt.global` gains `python3-venv`, which is the actual fix. Arch already bundles ensurepip with its `python` package, and `brew.global` installs a full `python`, so this only affects the Debian path.
`config/nvim/lua/plugins/lsp.lua` now checks for venv support before adding `basedpyright` to `ensure_installed`, mirroring the `has_public_npm()` guard already there for the npm-sourced servers. On a machine that lacks it the user gets one warning naming the package to install, instead of a failed install on every startup. `ruff` is unconditional now that it is separated out, since it has no such dependency.
## Testing
Reproduced the venv failure directly, then confirmed the guard drops `basedpyright` and leaves the rest intact:
```
$ XDG_CONFIG_HOME=/tmp/cfg nvim --headless -c 'lua ... spec[2].opts.ensure_installed' -c qa
python3 venv unavailable (install python3-venv): skipping LSP server basedpyright
ensure_installed={ "ruff", "ts_ls", "svelte", "html", "cssls", "bashls" }
```
A full startup against the branch config emits the one warning and writes no new mason install-failure entries to `~/.local/state/nvim/mason.log`.
Note that the container's `~/.config/nvim` is a copy baked in at image build time, not a symlink to this checkout, so the dejima image needs a rebuild to pick either change up.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Debian ships venv's ensurepip in a separate python3-venv package. Without
it, `python3 -m venv` exits 1, so mason cannot build the venv it installs
basedpyright into, and mason-lspconfig reports a failed install on every
startup.
Add python3-venv to the apt package list, and guard the basedpyright entry
in ensure_installed the same way the npm-sourced servers are already
guarded, so a machine missing it gets one warning instead of a failed
install every time.
branderson
approved these changes 2026-08-17 14:42:50 -07:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary generated by LLM agent
Fixes the
[mason-lspconfig.nvim] failed to install basedpyrighterror that appears on every nvim startup in the dejima container.Cause
mason installs
basedpyrightfrom PyPI, which means creating a venv for it first (mason-core/installer/managers/pypi.lua). Debian ships venv'sensurepipin a separatepython3-venvpackage rather than withpython3itself, and the container image doesn't have it, sopython3 -m venvexits 1:which matches the mason log exactly:
ruffinstalls fine alongside it because mason pulls that one as a prebuilt binary from a GitHub release, not from PyPI, so it never touches a venv. TheProvider "pypi" "get_supported_python_versions" failed: wget failed with exit code 4line just above it in the log is a separate, transient startup race: pypi.org, files.pythonhosted.org and api.github.com are all reachable from the container, and that provider call failing only means mason skips the Python version compatibility check, it does not fail the install.Changes
packages/apt.globalgainspython3-venv, which is the actual fix. Arch already bundles ensurepip with itspythonpackage, andbrew.globalinstalls a fullpython, so this only affects the Debian path.config/nvim/lua/plugins/lsp.luanow checks for venv support before addingbasedpyrighttoensure_installed, mirroring thehas_public_npm()guard already there for the npm-sourced servers. On a machine that lacks it the user gets one warning naming the package to install, instead of a failed install on every startup.ruffis unconditional now that it is separated out, since it has no such dependency.Testing
Reproduced the venv failure directly, then confirmed the guard drops
basedpyrightand leaves the rest intact:A full startup against the branch config emits the one warning and writes no new mason install-failure entries to
~/.local/state/nvim/mason.log.Note that the container's
~/.config/nvimis a copy baked in at image build time, not a symlink to this checkout, so the dejima image needs a rebuild to pick either change up.🤖 Generated with Claude Code