roxma / vim-hug-neovim-rpc

EXPERIMENTAL
MIT License
218 stars 28 forks source link

failed executing: pythonx import neovim (archlinux) #28

Closed Manu-sh closed 6 years ago

Manu-sh commented 6 years ago

Im on Vim 8.1:

Following statements are true:

has('pythonx')
has('python')
has('python3')

neovim seem to be installed correctly:

Python 2.7.15 (default, May  1 2018, 20:16:04) 
[GCC 7.3.1 20180406] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import neovim
>>> 

Python 3.6.5 (default, May 11 2018, 04:00:52) 
[GCC 8.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import neovim
>>> 

When i open vim i get this error:

[vim-hug-neovim-rpc] failed executing: pythonx import neovim
[vim-hug-neovim-rpc] Vim(pythonx):Traceback (most recent call last)

As cfg i have:

" Deoplete
set pyxversion=3
set encoding=utf-8
let g:python_host_prog = "/usr/bin/python2"
let g:python3_host_prog = "/usr/bin/python3"
let g:deoplete#enable_at_startup = 1

Plugin 'roxma/nvim-yarp'
Plugin 'roxma/vim-hug-neovim-rpc'
Plugin 'Shougo/deoplete.nvim'
Shougo commented 6 years ago

You should test pythonx import neovim in Vim command line. It seems does not work.

It is not vim-hug-neovim-rpc problem.

Shougo commented 6 years ago

I have tested pythonx import neovim in Manjaro Linux. It does work.

Manu-sh commented 6 years ago

I have typed :pythonx import neovim and this is the output:

Traceback (most recent call last):                                                                                                                                           
  File "<string>", line 1, in <module>
  File "/home/user/.local/lib/python3.6/site-packages/neovim/__init__.py", line 11, in <module>
    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,
  File "/home/user/.local/lib/python3.6/site-packages/neovim/msgpack_rpc/__init__.py", line 10, in <module>
    from .session import ErrorResponse, Session
  File "/home/user/.local/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
Manu-sh commented 6 years ago

so i should close the issue ?

Shougo commented 6 years ago

Yes.

You need to reinstall greenlet library.

Manu-sh commented 6 years ago

yes i have reinstalled greenlet library and now work properly (thx)

ghost commented 6 years ago

I'm having the same issue, but with /usr/lib/python3.7. Reinstalling greenlet did nothing to help. Everything else is the same as this post.

qJkee commented 6 years ago

Same here

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/neovim/__init__.py", line 11, in <module>
    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,
  File "/usr/lib/python3/dist-packages/neovim/msgpack_rpc/__init__.py", line 10, in <module>
    from .session import ErrorResponse, Session
  File "/usr/lib/python3/dist-packages/neovim/msgpack_rpc/session.py", line 7, in <module>
    import greenlet
ModuleNotFoundError: No module named 'greenlet'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
    from apport.fileutils import likely_packaged, get_recent_crashes
  File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
    from apport.report import Report
  File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
    import apport.fileutils
  File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
    from apport.packaging_impl import impl as packaging
  File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/neovim/__init__.py", line 11, in <module>
    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,
  File "/usr/lib/python3/dist-packages/neovim/msgpack_rpc/__init__.py", line 10, in <module>
    from .session import ErrorResponse, Session
  File "/usr/lib/python3/dist-packages/neovim/msgpack_rpc/session.py", line 7, in <module>
    import greenlet
ModuleNotFoundError: No module named 'greenlet'
Thesola10 commented 5 years ago

For those who found this ticket trying to solve this kind of crash:

Don't use the pip version of greenlet on Arch.

ghost commented 5 years ago

by installing sudo pacman -S python-greenlet it works, but when I use it inside virtualenv it fails with above errors

Thesola10 commented 5 years ago

by installing sudo pacman -S python-greenlet it works, but when I use it inside virtualenv it fails with above errors

While pacman does install greenlet, it only does so in the same place as pip would. Loading a virtualenv discards packages such as greenlet so you have to link the Arch version into your virtualenv as well.

ghost commented 5 years ago

While pacman does install greenlet, it only does so in the same place as pip would. Loading a virtualenv discards packages such as greenlet so you have to link the Arch version into your virtualenv as well.

Fantastic! Cheers, this worked perfectly, I was actually not aware of this problem, just starting out with virtual envs tbh.

For anyone still needing this solution install your virtual env (depending on provider) in similar fashion: mkvirtualenv --system-site-packages <env-name> --system-site-packages flag enables system wide installed packages, which in our case is python-greenlet

anbuksv commented 5 years ago

by direct reinstalling greenlet library or installing sudo pacman -S python-greenlet are not worked for me because both use the precompiled wheel/binary.

As per pip install guidance this solution worked for me
pip3 uninstall pynvim
cd ~/.local/lib/python3.7/site-packages/
rm -r greenlet-0.4.15-py3.7.egg-info greenlet.cpython-37m-x86_64-linux-gnu.so
pip3 install --user --no-binary :all: pynvim

Reference https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-no-binary https://www.archlinux.org/packages/community/x86_64/python-greenlet/files/ https://bbs.archlinux.org/viewtopic.php?id=232873

StarryLeo commented 5 years ago

@anbuksv Thank you for your answer, my question is the same as yours. But I don't have this file greenlet-0.4.15-py3.7.egg-info , I do rm -rf greenlet-0.4.15.dist-info, and deoplete work. But I do :echo neovim_rpc#serveraddr(), I get /tmp/veSlECq/2. @roxma

korsmakolnikov commented 4 years ago

Same issue on macos mojave

Shougo commented 4 years ago

@korsmakolnikov Please read this. https://github.com/roxma/vim-hug-neovim-rpc/issues/36