roxma / nvim-yarp

Yet Another Remote Plugin Framework for Neovim
MIT License
229 stars 14 forks source link

nvim-yarp fails when python3_host_prog is pointed towards virtualenv #38

Closed pranavtaysheti closed 4 years ago

pranavtaysheti commented 4 years ago

I have created a python3 virtualenv specifically for the neovim and installed the packages required by nvim and its plugins there. after setting g:python3_host_prog = '~/nvim/venv/bin/python' neovim starts as expected and :checkhealth is not giving me any error. but for some reason nvim-yarp keeps failing on startup flashing an error message on startup. it doesnt show error if i comment g:python3_host_prog line from my .nvimrc

OUTPUTS:

pip list of virtualenv:

(venv) [precrisk@prefros nvim]$ pip list
Package           Version
----------------- -------
astroid           2.3.3  
autopep8          1.4.4  
entrypoints       0.3    
flake8            3.7.9  
greenlet          0.4.15 
isort             4.3.21 
jedi              0.15.1 
lazy-object-proxy 1.4.3  
mccabe            0.6.1  
msgpack           0.6.2  
neovim            0.3.1  
parso             0.5.1  
pip               19.3.1 
powerline-status  2.7    
pycodestyle       2.5.0  
pyflakes          2.1.1  
pylint            2.4.4  
pynvim            0.4.0  
setuptools        41.2.0 
six               1.13.0 
wrapt             1.11.2 

:checkhealth

 33 ## Python 2 provider (optional)
 34   - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
 35   - ERROR: Python provider error:
 36     - ADVICE:
 37     ¦ - provider/pythonx: Could not load Python 2:
 38     ¦   ¦ /usr/bin/python2 does not have the "neovim" module. :help ¦provider-python¦
 39     ¦   ¦ /usr/bin/python2.7 does not have the "neovim" module. :help ¦provider-python¦
 40     ¦   ¦ python2.6 not found in search path or not executable.
 41     ¦   ¦ /usr/bin/python is Python 3.8 and cannot provide Python 2.
 42   - INFO: Executable: Not found
 43  
 44 ## Python 3 provider (optional)
 45   - INFO: Using: g:python3_host_prog = "~/nvim/venv/bin/python"
 46   - INFO: Executable: /home/precrisk/nvim/venv/bin/python
 47   - INFO: Python version: 3.8.0
 48   - INFO: pynvim version: 0.4.0
 49   - OK: Latest pynvim is installed.

my project .nvimrc file with all nvim-yarp related config.

let g:python3_host_prog = '~/nvim/venv/bin/python'
call plug#begin()
Plug 'roxma/nvim-yarp'
Plug 'ncm2/ncm2'
Plug 'ncm2/ncm2-bufword'
Plug 'ncm2/ncm2-path'
Plug 'ncm2/ncm2-jedi'
call plug#end()
autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect

error message during nvim startup. this doesnt show if i comment out g:python3_host_prog Screenshot from 2019-11-24 19-04-24

Shougo commented 4 years ago

You should expand ~.

let g:python3_host_prog = expand('~/nvim/venv/bin/python')
Shougo commented 4 years ago

@Precrisk #39 fixes your problem.

pranavtaysheti commented 4 years ago

Thankyou, after using expand its working again.