vim-hug-neovim-rpc: Could not find neovim

I have installed neovim via pip install neovim, and in vim the command :python import neovim has no errors. However, when I opened the vim, it reported that No module named 'neovim'.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 34 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Having a similar issue on Arch, running :pythonx import neovim I got this stack trace:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.6/site-packages/neovim/__init__.py", line 11, in <module>
    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,
  File "/usr/lib/python3.6/site-packages/neovim/msgpack_rpc/__init__.py", line 10, in <module>
    from .session import ErrorResponse, Session
  File "/usr/lib/python3.6/site-packages/neovim/msgpack_rpc/session.py", line 6, in <module>
    import greenlet
ImportError: /usr/lib/python3.6/site-packages/greenlet.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_ValueError

But running python3 -c 'import neovim' worked fine.

This lead me to this issue over at python-greenlet python-greenlet/greenlet#122 where the recommended solution is to downgrade greenlet to 0.4.10.

After running sudo pip3 install greenlet==0.4.10 vim boots up fine.

Hope this helps anyone else running into this problem ๐Ÿ˜„

@stevenmwade pip3 install neovim is needed.

Just installed pip2 install --user neovim and this work for mi. View: https://robertbasic.com/blog/force-python-version-in-vim/

@matarc Hi, ๐Ÿ˜„ I upgrade my vim by Homebrew and Itโ€™s working fine now ! The error may caused by you upgraded your python but donโ€™t re-compile your vim!

@willian

This plugin choose pythonx if has('pythonx'), then python3, then python.

In your case, you need to ensure :pythonx import neovim works. Which implies ensuring :python import neovim should work, judging by the information you provided.

As an alternative, you could try add set pyxversion=3 into your vimrc, since :python3 import neovim works on your system.