Neovim Mason plugin cannot install Linters or Formatters

3.2k Views Asked by At

I'm quite new to neovim and mostly use it for simple c++ development. Love the motions and customizability, however I cannot find what I'm doing wrong when trying to install the clang-formatter using Mason plugin.

Using the visual interface provided by Mason I navigate to the 'formatter' section, position my cursor on the clang-formatter option and press I. It starts something but always fails with the same error message:
Mason Error Message

(I get the same error when installing linters)

So far installing LSP's has been no problem, and I've tried to google what the 'Error: name cmd not found' meant but haven't found anything that seems related.

I've made sure to update both my python3 and python3-pip packages. I believe that the virtual environment package became standard since python3.3 so I haven't installed that separately.

':checkhealth mason' output
My Check Health

If anybody has experienced something similar I'd love to hear how you've solved it!

3

There are 3 best solutions below

0
Yohann Tümpling On

Did you installed pynvim? It is what makes the bridge between neovim and python stuff I guess, it is optional to have it but could fix your issue. My healthcheck looks like this :

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.8.10
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

To install pynvim (in your shell):

pip3 install pynvim
1
Cong On

I solved it using sudo apt install python3.10-venv, depending on your Python3 version.

0
Devang Bhagwat On

I solved it using the command: sudo apt install python3-venv (I am using the Ubuntu 20.04 OS)