You are not logged in.

#1 2019-02-21 18:51:13

Kalixyz
Member
Registered: 2019-02-16
Posts: 11

[SOLVED]Nvim with python

Hi i currently having major problems with my nvim. I wanted to test out ultisnips, hence i had to get python support for my nvim.
I have tried to install pynvim with the command:

 sudo pip3 install pynvim 

But when i ran :checkhealth in nvim i saw python was installed but ultisnips still did not work.
The only "error" i saw was:

 - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment. 

Since i ran a rice script to get most of my stuff installed i just decided to remove nvim and start from scratch....
(Bad idea for a n00b lol)

I took a backup of my init.conf and removed them with this command.

 pacman -Rcs nvim 
sudo pip uninstall pynvim 

Even ran bleachbit and rebooted just to be sure no temp files would still be left.
Then i reinstalled nvim and pynvim.
Now the nvim :checkhealth status is just a clusterf*** to say the least..... Here is the output under python.....

  
- INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
- INFO: Executable: /usr/bin/python3
- ERROR: Command error (job=5, exit code 1): `'/usr/bin/python3' -c 'import sys; sys.path.remove(""); import neovim; print(neovim.__file__)'` (in '/home/kali')
Output: Traceback (most recent call last):  File "<string>", line 1, in <module>  File "/usr/lib/python3.7/site-packages/neovim/__init__.py", line 5, in <module>    import pynvim  File "/usr/lib/python3.7/site-packages/pynvim/__init__.py", line 11, in <module>    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,  File "/usr/lib/python3.7/site-packages/pynvim/msgpack_rpc/__init__.py", line 10, in <module>    from .session import ErrorResponse, Session  File "/usr/lib/python3.7/site-packages/pynvim/msgpack_rpc/session.py", line 7, in <module>    import greenletModuleNotFoundError: No module named 'greenlet'
Stderr: Traceback (most recent call last):  File "<string>", line 1, in <module>  File "/usr/lib/python3.7/site-packages/neovim/__init__.py", line 5, in <module>    import pynvim  File "/usr/lib/python3.7/site-packages/pynvim/__init__.py", line 11, in <module>    from .msgpack_rpc import (ErrorResponse, child_session, socket_session,  File "/usr/lib/python3.7/site-packages/pynvim/msgpack_rpc/__init__.py", line 10, in <module>    from .session import ErrorResponse, Session  File "/usr/lib/python3.7/site-packages/pynvim/msgpack_rpc/session.py", line 7, in <module>    import greenletModuleNotFoundError: No module named 'greenlet'
  - INFO: Python version: 3.7.2
  - INFO: pynvim version: unable to load neovim Python module
  - ERROR: pynvim is not installed.
    Error: unable to load neovim Python module
    - ADVICE:
    - Run in shell: pip3 install pynvim

The "advice" at the bottom is not helping what so ever, i ran the command with pip\pip2\pip3 after doing ALL that stuff above(reinstalling etc) still nothing...
Also tried it after i installed it like the "advice" said.... Here is the output:

Requirement already satisfied: pynvim in /usr/lib/python3.7/site-packages (0.3.2)
Requirement already satisfied: msgpack>=0.5.0 in /usr/lib/python3.7/site-packages (from pynvim) (0.6.1)
Requirement already satisfied: greenlet in /usr/lib/python3.7/site-packages (from pynvim) (0.4.15)

Is there any EASY way to install nvim with python support?
I just wanna test out a freaking plugin for crying out loud, and it feels like i have to recompile the universe without any documentation about anything! lol
(I do not want gvim since i need this to work on a headless box)

I have spent around 2 days to TRY and get ultisnips to work... And it is driving me insane at this point. So any kind of help would be much appreciated! smile
It is not only the plugin, python is something i feel should be native, so at this point it's almost getting personal lol

Last edited by Kalixyz (2019-02-21 19:53:47)

Offline

#2 2019-02-21 19:34:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED]Nvim with python

Do not EVER install different package managers packages as root, especially not if you are new and can't assess the consequences. Don't run sudo pip anything, ever.

That out of the way, now that you are that far, use sudo pip to remove all of them. And then, instead of running to pip the first chance you get, take a look at the optional dependencies of neovim, there's a reason a package called python-neovim exists.

Last edited by V1del (2019-02-21 19:36:36)

Offline

#3 2019-02-21 19:52:13

Kalixyz
Member
Registered: 2019-02-16
Posts: 11

Re: [SOLVED]Nvim with python

You sir you are a godsend, and trust me i learned my lesson! lol
Removed everything i installed as root.

Btw I ran the same command probably 2 or 3 times before, but in my frustration i must have miss spelled it. lol
Hahaha, at this point i cant do much else but laugh.
Again a big sincere THANK YOU! smile

Last edited by Kalixyz (2019-02-21 19:52:46)

Offline

Board footer

Powered by FluxBB