Hello,
I recently setup my nvim environment and I can’t seem to figure out why pyright does not seem to recognized my environment even though the lsp seems to be working fine. (go to definition works, I can even go to the definition of the import its saying its unable to import)
Here is my lspconfig
I’ve verify that in :checkhealth
nvim seems to recognized my environment. (I don’t have neovim installed in my python environment, I don’t think that is needed?)
provider.python: require("provider.python.health").check()
Python 3 provider (optional) ~
- WARNING No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- WARNING Could not load Python :
/Users/darren/Library/Caches/pypoetry/virtualenvs/simple-platformer-grm8zU49-py3.12/bin/python3 does not have the "neovim" module.
/Users/darren/Library/Caches/pypoetry/virtualenvs/simple-platformer-grm8zU49-py3.12/bin/python3.12 does not have the "neovim" module.
python3.11 not found in search path or not executable.
python3.10 not found in search path or not executable.
python3.9 not found in search path or not executable.
python3.8 not found in search path or not executable.
python3.7 not found in search path or not executable.
/Users/darren/Library/Caches/pypoetry/virtualenvs/simple-platformer-grm8zU49-py3.12/bin/python does not have the "neovim" module.
- ADVICE:
- See :help |provider-python| for more information.
- You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
- Executable: Not found
Python virtualenv ~
- $VIRTUAL_ENV is set to: /Users/darren/Library/Caches/pypoetry/virtualenvs/simple-platformer-grm8zU49-py3.12
- Python version: 3.12.6
- OK $VIRTUAL_ENV provides :!python.
LspInfo also looks ok to me
==============================================================================
lspconfig: require("lspconfig.health").check()
LSP configs active in this session (globally) ~
- Configured servers: bashls, pyright, cssls, html, ts_ls, lua_ls, clangd, robotframework_ls
- OK Deprecated servers: (none)
LSP configs active in this buffer (id=(invalid buffer)) ~
- Language client log: ~/.local/state/nvim/lsp.log
- Detected filetype: `(invalid buffer)`
- 0 client(s) attached to this buffer
- 1 active client(s) not attached to this buffer:
- Client: pyright (id: 1, bufnr: [6, 3])
filetypes: python
root directory: ~/code/simple_platformer
cmd: ~/.local/share/nvim/mason/bin/pyright-langserver --stdio
autostart: true
Docs for active configs: ~
-
running :!which python
also seems to recognized my env
:!which python
/Users/darren/Library/Caches/pypoetry/virtualenvs/simple-platformer-grm8zU49-py3.12/bin/python
I honestly don’t know what else to do. help