Closed TravisDart closed 4 years ago
I tried many different configuration combinations, and found one that works. The solution is to use
"python.pythonPath": "~/.pyenv/shims/python"
This is the full coc-settings.json:
{
"python.pythonPath": "~/.pyenv/shims/python",
"python.formatting.provider": "yapf",
"python.formatting.yapfPath": "~/.pyenv/versions/neovim3/bin/yapf",
"python.jediEnabled": true,
"python.jediPath": "~/.pyenv/versions/neovim3/lib/python3.8/site-packages/",
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Path": "~/.pyenv/versions/neovim3/bin/flake8",
"python.sortImports.path": "~/.pyenv/versions/neovim3/bin/isort",
"python.linting.lintOnSave": false,
"python.autoUpdateLanguageServer": false,
"python.disableInstallationCheck": true
}
I have a virtual environment for neovim which holds jedi, yapf, flake8, etc. I don't want to install the Python packages for neovim in the global environment or my project's virtual environment, and this creating a virtual environment for neovim is the only way I know to do this.
My neovim config is below. The coc.vim.conf file is the Example vim configuration on the coc.nvim readme.
My coc-settings.json:
:checkhealth output:
Now, when I create a test project, the wrong virtual environment is identified, and the Django packages don't autocomplete.
The satus line says:
Python 3.8.2 64-bit ('neovim3': venv)
Shouldn't this identify the
djangotest
virtual environment?Also, when I type
from django.shortcuts
no part of "shortcuts" gets an autocomplete suggestion. However, when I typefrom yapf.
, theyapflib
submodule is suggested. I think this means that the current virtual environment is not being used for the autocomplete.What am I doing wrong? How do I get the current virtual environment to be used for autocomplete, while keeping the neovim modules in their own (separate) virtual environment?