williamboman / mason.nvim

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
Apache License 2.0
7.23k stars 258 forks source link

feat(pypi): attempt more python3 candidates #1608

Closed williamboman closed 5 months ago

chrisgrieser commented 5 months ago

Okay, so I just gave this a try, and it looks like it's not working for me? To test, I installed pylint, and it still uses the system python on 3.9.

> which -a python3.12
/opt/homebrew/bin/python3.12
> which -a python3
/usr/bin/python3
> which -a python3.9
python3.9 not found
> which -a python
python not found
> test -e /Library/Developer/CommandLineTools/usr/bin/python3.9 && echo "exists"
exists
> echo $PATH /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/chrisgrieser/.local/share/nvim/mason/bin

Content of the pyvenv.cfg of the pylint package installed by mason:

home = /Library/Developer/CommandLineTools/usr/bin
include-system-site-packages = false
version = 3.9.6

For some reason, it appears mason is using the python3.9 installed by the macOS command line utilities (installed via xcode-select --install, required for homebrew to work), even though the folder is not in my PATH.

Just in case, I ran :lua= vim.env.PATH inside nvim, which gives this result:

/Users/chrisgrieser/.local/share/nvim/mason/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/chrisgrieser/.local/share/nvim/mason/bin:/opt/homebrew/bin

And :! which -a python 3.9 gives this:

:!which -a python3.9
python3.9 not found
shell returned 1
chrisgrieser commented 5 months ago

ugh, nevermind, I simply had a typo, I copied eat/more-python-candidates instead of feat/more-python-candidates. Without the typo, everything works correctly. 🤦‍♂️