Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

(Neo)vim python support and active virtualenv conflict

I've got ordinarily supported Python under Neovim

init.vim:

" Plug 'plytophogy/vim-virtualenv'

 if has('nvim')
  Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
 else
  Plug 'Shougo/deoplete.nvim'
  Plug 'roxma/nvim-yarp'
  Plug 'roxma/vim-hug-neovim-rpc'
 endif
 Plug 'zchee/deoplete-jedi'
 Plug 'davidhalter/jedi-vim'

When I start nvim when some virtual environment is active, it begins with this error message

UltiSnips requires py >= 2.7 or py3
Press ENTER or type command to continue

then a lot more, of course.

Personally I am not surprised. Plugins' Python code should not be run inside a virtual environment which has nothing to do with it. Yet I have to. What can I do?

vim-virtualenv apparently does not have anything to do with this problem in any way. Does not address it, too.

like image 966
Alexey Orlov Avatar asked Jul 21 '26 10:07

Alexey Orlov


1 Answers

See this documentation for Neovim providers:

PYTHON PROVIDER CONFIGURATION ~
                        *g:python_host_prog*
Command to start Python 2 (executable, not directory). Setting this makes
startup faster. Useful for working with virtualenvs.  >
    let g:python_host_prog  = '/path/to/python'
<
                        *g:python3_host_prog*
Command to start Python 3 (executable, not directory). Setting this makes
startup faster. Useful for working with virtualenvs.  >
    let g:python3_host_prog = '/path/to/python3'
like image 95
Hari Amoor Avatar answered Jul 22 '26 22:07

Hari Amoor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!