python-lsp / pylsp-mypy

Mypy plugin for the Python LSP Server.
MIT License
118 stars 35 forks source link

Noob question: How do I install pylsp_mypy in Neovim with Mason? #80

Closed PhilippFeO closed 5 months ago

PhilippFeO commented 5 months ago

I use python-lsp-server in Neovim and have installed it via Mason. Now, I wonder how I install plugins like pylsp_mypy in this setup.

Thank you!

PhilippFeO commented 5 months ago

Nevermind, I finally managed it:

  1. Mason sets up a venv when installing python-lsp-server. It is located in ~/.local/share/nvim/mason/packages/python-lsp-server/venv.
  2. Activate the venv: source ~/.local/share/nvim/mason/packages/python-lsp-server/venv/bin/activate.
  3. Intall pylsp_mypy as described, ie pip install pylsp_mypy.
  4. Enable it with pylsp_my = { enabled = true }.