Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

failed executing: pythonx import neovim (archlinux) #28

Closed
Manu-sh opened this issue Jun 13, 2018 · 16 comments
Closed

failed executing: pythonx import neovim (archlinux) #28

Manu-sh opened this issue Jun 13, 2018 · 16 comments

Comments

@Manu-sh
Copy link

Manu-sh commented Jun 13, 2018

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
Copy link
Collaborator

Shougo commented Jun 13, 2018

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

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

@Shougo
Copy link
Collaborator

Shougo commented Jun 13, 2018

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

@Manu-sh
Copy link
Author

Manu-sh commented Jun 13, 2018

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
Copy link
Author

Manu-sh commented Jun 13, 2018

so i should close the issue ?

@Shougo
Copy link
Collaborator

Shougo commented Jun 13, 2018

Yes.

You need to reinstall greenlet library.

@Manu-sh Manu-sh closed this as completed Jun 14, 2018
@Manu-sh Manu-sh reopened this Jun 14, 2018
@Manu-sh
Copy link
Author

Manu-sh commented Jun 14, 2018

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

@Manu-sh Manu-sh closed this as completed Jun 14, 2018
@roxma roxma mentioned this issue Jul 29, 2018
@ghost
Copy link

ghost commented Aug 6, 2018

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
Copy link

qJkee commented Sep 18, 2018

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
Copy link

Thesola10 commented Dec 21, 2018

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

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

@ghost
Copy link

ghost commented Dec 22, 2018

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

@Thesola10
Copy link

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
Copy link

ghost commented Dec 22, 2018

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
Copy link

anbuksv commented Jan 5, 2019

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
Copy link

@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
Copy link

Same issue on macos mojave

@Shougo
Copy link
Collaborator

Shougo commented May 5, 2020

@korsmakolnikov Please read this.
#36

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants