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
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'
0

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 at 0:22
  • The entry point. init.vim may be? – Luc Hermitte Jan 18 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 at 0:35
  • With vim, I know. With nvim, it's just wild guesses on my part. – Luc Hermitte Jan 18 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 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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