0

Im using pyenv to administer my python versions (Im on Manjaro Linux) and the command for python on my system is python but nvim wants to use python3. How can I change it?

Error:

[coc.nvim] Error on execute python script: request error nvim_command - Vim(pyxf
ile):E319: No "python3" provider found. Run ":checkhealth provider"

Here is a prt of my init.vim file:

" coc config
let g:coc_global_extensions = [
  \ 'coc-snippets',
  \ 'coc-pairs',
  \ 'coc-tsserver',
  \ 'coc-eslint', 
  \ 'coc-prettier', 
  \ 'coc-json', 
  \ 'coc-sh',
  \ 'coc-clangd',
  \ 'coc-cmake',
  \ 'coc-jedi'
  \ ]
1

4 Answers 4

1

If nvim works like Vim on this topic, as a I see pyxfile in your error message, you should be able to force 'pyxversion' to 2 in your .vimrc (or equivalent with nvim)

set pyxversion=2

This may cause troubles with plugins that explicitly request :py3 commands as it would not longer be available once the first use of a :py or :pyx command has been issued.

7
  • I dont have something called .vimrc. I have files like that: ls -la | grep vim .nvim .vim .viminfo which one should i use?
    – John
    Jan 18, 2021 at 0:22
  • The entry point. init.vim may be? Jan 18, 2021 at 0:33
  • Yes, I do have init.vim i place my configs there. Sorry Im new to vim and don't know its structure
    – John
    Jan 18, 2021 at 0:35
  • With vim, I know. With nvim, it's just wild guesses on my part. Jan 18, 2021 at 0:36
  • I added it and now I get this: [coc.nvim] Error on execute python script: request error nvim_command - Vim(pyxf ile):E319: No "python" provider found. Run ":checkhealth provider" It cannot find python for some reason
    – John
    Jan 18, 2021 at 0:37
1

Because my system does not name the default python interpreter as python3, but as python I simply added a shell alias:

alias python3='python'
1

i solved mine by doing this python -m pip --user --upgrade pynvim. PyNvim is a provider for python in NVIM

and later in the config file at ~/.config/nvim/init.vim add this line saying which python to use let g:python3_host_prog = '/usr/bin/python'

2
0

I solved that issue by installing pynvim package for all Python 3 releases that was described in: :checkhealth provider

In my system, I have python3.10 and python3.9, so I run:

python3.10 -m pip install --user pynvim
python3.9 -m pip install --user pynvim

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.