Open VRehnberg opened 4 days ago
A quick fix for me was to modify https://github.com/williamboman/mason.nvim/blob/main/lua/mason-core/installer/managers/pypi.lua#L91:
- local target = resolve_python3(versioned_candidates) or stock_target
+ local target = stock_target
My suggested solution would be to just use stock_target and check if it is compatible. If isn't, throw an error and exit rather than trying to use a non-default python. (But, that could be a breaking change for those that rely on the old behaviour).
I've searched open issues for similar requests
I've manually reviewed logs to find potential errors
I've recently downloaded the latest plugin version of mason.nvim
Problem description
From a conda environment with Python 3.9.17 (picked up by
:checkhealth mason
) pypi installer picks up and uses system python version 3.10. Output from MasonLog:Expected behavior
PATH should be respected. It looks like the culprit is
[resolve_python3](https://github.com/williamboman/mason.nvim/blob/main/lua/mason-core/installer/managers/pypi.lua#L20-L33)()
and probably the call for versioned candidates at https://github.com/williamboman/mason.nvim/blob/main/lua/mason-core/installer/managers/pypi.lua#L91Instead of taking the python resolved by PATH it picks the latest python version that is supported.
Steps to reproduce
PATH="append"
(or"skip"
):Affected packages
ruff-lsp
Neovim version (>= 0.7)
NVIM v0.10.0 Build type: RelWithDebInfo LuaJIT 2.1.1713484068
Operating system/version
Linux c3se-TP6 6.5.0-41-generic #41~22.04.2-Ubuntu SMP PREEMPT_DYNAMIC Mon Jun 3 11:32:55 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Healthcheck
Screenshots or recordings
No response