Shougo / deoplete.nvim

:stars: Dark powered asynchronous completion framework for neovim/Vim8
Other
5.94k stars 295 forks source link

Mac OS X: VIM 8 - E605: Exception not caught: [vim-hug-neovim-rpc] requires one of `:pythonx import [pynvim|neovim]` command to work #1196

Closed Technophobe01 closed 2 years ago

Technophobe01 commented 2 years ago

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

The homebrew version of macvim is distributed with python included. Thus, when you try to install pynvim from the command line it will likely be installed in the wrong library location. This results in the headline error. The solution is to set the python path in the .vimrc file and use homebrew to link to the python version installed by macvim.

brew install macvim

brew link --overwrite python@3.10 export PATH="/usr/local/opt/python@3.10/bin:$PATH" pip3 install --user --upgrade pynvim vim

Expected

No error

Environment Information

Provide a minimal init.vim/vimrc with less than 50 lines (Required!)


" ================ Python Config =====================
"
set pythonthreedll=/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/Python
set pythonthreehome=/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/

"================ deplete ===========================
" 
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
let g:deoplete#enable_at_startup = 1

How to reproduce the problem from neovim/Vim startup (Required!)

brew install python@3.9 brew install macvim brew install python@3.10 which python3 /usr/local/opt/python@3.9/bin/python3 ----- If we now try to install pynvim it will install in the 3.9 path... (bad) pip3 install --user --upgrade pynvim

vim Error: E605: Exception not caught: [vim-hug-neovim-rpc] requires one of :pythonx import [pynvim|neovim] command to work :pythonx import sys; print(sys.path)

['/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python310.zip', '/usr/local/Cellar/py thon@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10', '/usr/local/Cellar/python@3.10/3.10.4/Framewor ks/Python.framework/Versions/3.10/lib/python3.10/lib-dynload', '/Users/pkjar/Library/Python/3.10/lib/python/site-packages' , '/usr/local/Cellar/python@3.10/3.10.4/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages', '_vim_pat h_'] :q! ------ fix... brew link --overwrite python@3.10 export PATH="/usr/local/opt/python@3.10/bin:$PATH" pip3 install --user --upgrade pynvim vim # No errors... ## Generate a logfile if appropriate 1. export NVIM_PYTHON_LOG_FILE=/tmp/log 2. export NVIM_PYTHON_LOG_LEVEL=DEBUG 3. nvim -u minimal.vimrc 4. some works 5. cat /tmp/log_{PID} ## Screenshot (if possible) ## Upload the log file ![2022-05-16_15-17-53](https://user-images.githubusercontent.com/749230/168693900-995dfcfd-39e4-4a7b-9c5e-8e8f05f7b85a.png)
Shougo commented 2 years ago

It is not the issue of deoplete.

Technophobe01 commented 2 years ago

@Shougo Agreed, I felt it was useful to document so if people encounter the error then it is tracked here. My hope is it makes the installation easier as it is a non-obvious problem. Your work here and on other projects is appreciated. Stay safe and well.

Shougo commented 2 years ago

OK. I will add it later.

Shougo commented 2 years ago

I have added it.