New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get it to work #36

Open
mandreyel opened this Issue Aug 11, 2018 · 22 comments

Comments

Projects
None yet
9 participants
@mandreyel

mandreyel commented Aug 11, 2018

Hello,

first of, apologies if this is not the right place to ask. I cannot for the life of me figure out how to get this plugin to work. I have vim version 8.1 with python3 support (has('pythonx') and has('python3') both return 1) and I have installed neovim via pip (both locally with the --user flag and globally with sudo to see if it changes anything), but when running :echo neovim_rpc#serveraddr(), this is what I get:

[vim-hug-neovim-rpc] failed executing: pythonx import neovim
[vim-hug-neovim-rpc] Vim(pythonx):Traceback (most recent call last):
Error detected while processing function neovim_rpc#serveraddr:
line   15:
E605: Exception not caught: [vim-hug-neovim-rpc] requires `:pythonx import neovim` command to work
Press ENTER or type command to continue

Have I perhaps missed an installation step?

Thanks in advance!

@frescoraja

This comment has been minimized.

frescoraja commented Aug 14, 2018

Hi mandreyel

I think the reason you may be seeing this is that neovim module is not installed for the python3 version which Vim is configured to use.

how did you install vim and python?

assuming you are on a mac, I think if you install vim and python both via homebrew (and symlink to homebrew python executables in pyenv if you are using it), this could be a solution.

..or try removing python version management and rerun pip install commands using system pythons

hope that helps

@mandreyel

This comment has been minimized.

mandreyel commented Aug 15, 2018

Hey, thanks for your response!

I completely neglected to mention my platform, which is Linux, so not using homebrew, and python came preinstalled on my system, as did vim, I believe.

However, you may have a point there. How do I check which python version vim is using [as in, which specific binary]? Also, shouldn't this be solved by having installed the neovim module with both pip and pip3, in both cases with the --user flag and without it?

Appreciate the help

@jparr721

This comment has been minimized.

jparr721 commented Aug 15, 2018

I am running into this issue recently. My Arch Linux configurations are all running python3 and vim 8+. I usually use the fix here, but when I try to downgrade greenlet to 0.4.10 it just blows up at me.

Any tips on how to fix it?

@mandreyel

This comment has been minimized.

mandreyel commented Aug 15, 2018

@jparr721 Thanks for linking in that issue, I must have missed it when checking for similar ones. Indeed, greenlet seems to be the culprit for me as well.

@mariusmagureanu

This comment has been minimized.

mariusmagureanu commented Aug 26, 2018

Same here, running on Arch with latest vim 8+ and python3;
I tried downgrading to greenlet 0.4.10 but cannot get it to install, gcc goes nuts with it and I didn't spend time trying to figure that one out. So I'm back on latest greenlet (0.4.14).

@Shougo

This comment has been minimized.

Contributor

Shougo commented Aug 26, 2018

You should try import neovim in Python3 interpreter.
I think it does not work in your enviroment.

I use Manjaro Linux and vim-hug-neovim-rpc works.

@mandreyel

This comment has been minimized.

mandreyel commented Aug 26, 2018

@Shougo importing neovim in a python3 interpreter does work, hence my confusion as to why it doesn't work from within vim.

@Shougo

This comment has been minimized.

Contributor

Shougo commented Aug 26, 2018

If so, Vim does not use the Python.
You should check the Python path.

@jparr721

This comment has been minimized.

jparr721 commented Aug 26, 2018

Check the python path from within vim you're saying?

@jparr721

This comment has been minimized.

jparr721 commented Aug 26, 2018

When I run :version python shows up at +python/dyn and +python3/dyn and yet I cannot import neovim from within vim with :python import neovim very strange...

@Shougo

This comment has been minimized.

Contributor

Shougo commented Aug 26, 2018

You can specify Python library by pythonthreedll option.

						*'pythonthreedll'*
'pythonthreedll'	string	(default depends on the build)
			global
			{not in Vi}
			{only available when compiled with the |+python3/dyn|
			feature}
	Specifies the name of the Python 3 shared library. The default is
	DYNAMIC_PYTHON3_DLL, which was specified at compile time.
	Environment variables are expanded |:set_env|.
	This option cannot be set from a |modeline| or in the |sandbox|, for
	security reasons.

When I run :version python shows up at +python/dyn and +python3/dyn and yet I cannot import neovim from within vim with :python import neovim very strange...

And you must test :python3 import neovim instead.

@jparr721

This comment has been minimized.

jparr721 commented Aug 26, 2018

Aren't dlls a windows only thing? Or am I mistaken?

@jparr721

This comment has been minimized.

jparr721 commented Aug 26, 2018

Also, I tested with :python3 import neovim and greenlet seems to be causing an issue when it is imported.

@Shougo

This comment has been minimized.

Contributor

Shougo commented Aug 26, 2018

Also, I tested with :python3 import neovim and greenlet seems to be causing an issue when it is imported.

You should remove greenlet library and reinstall neovim package.

@Shougo

This comment has been minimized.

Contributor

Shougo commented Aug 26, 2018

Aren't dlls a windows only thing? Or am I mistaken?

It is not only Windows environment.

@Shougo

This comment has been minimized.

Contributor

Shougo commented Aug 26, 2018

Please research about pythonthreedll. It is used widely.

@jparr721

This comment has been minimized.

jparr721 commented Aug 26, 2018

Ahh I see now. My pythonthreedll option looks the same as yours. Also, when removing the greenlet package and doing the neovim install again, neovim just pulls greenlet into the installation.

@strahlii

This comment has been minimized.

strahlii commented Sep 4, 2018

installing the greenlet and neovim from the aur instead of pip3 solved the problem for me.
sudo pip3 uninstall neovim
sudo pip3 uninstall greenlet
and then build https://aur.archlinux.org/packages/python-neovim-git/ with dependencies

i have no clue why this worked, tho.

@lucasteles

This comment has been minimized.

lucasteles commented Sep 14, 2018

When i update my vim to 8.1 the 'import neovim' not work on vim, but works on python3 shell

@Shadowsith

This comment has been minimized.

Shadowsith commented Sep 29, 2018

The solution of strahlii worked for me on Manjaro Linux for Vim 8.1
Should be added as workaround int the README for Arch/Manjaro users.

@kujohn

This comment has been minimized.

kujohn commented Nov 9, 2018

I am getting the same problem as @lucasteles.

@Shougo

This comment has been minimized.

Contributor

Shougo commented Nov 9, 2018

You should re-build Vim8.1 with Python3 support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment