coc-pyright: could not be resolved if use pyenv local
I use pyenv for manage virtualenv of python, but if use pyenv local
(.python-version file in local dir) in coc-pyright, raise reportMissingImports error on import something.
pyenv shell
is working. PYENV_VERSION environment variable can be accepted.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 18 (7 by maintainers)
I’ll test pyenv/pipenv later, trying to make it works with Pyright.
coc-pyright v1.1.106 adds support for
pyenv local
, please give it a try.@rid-32
Is the “workspace folder” resolved with the correct directory name?
Try to do
:echo WorkspaceFolders
orCocCommand workspace.workspaceFolders
Does the output show the name of the directory where
pyrightconfig.json
is located?If nothing is displayed or the correct directory is not displayed, you may want to put the following settings in
.vimrc
orinit.vim
.Ref: Resolve workspace folder https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders
@yaegassy
pyrightconfig.json
is working, but is not optimal, everyone project maybe place a file. In addition,python.venvPath
is not suitable for pyenv