mhinz / neovim-remote

:ok_hand: Support for --remote and friends.
MIT License
1.73k stars 83 forks source link

Installation trouble for python2.7 and pip #149

Closed devilyouwei closed 2 years ago

devilyouwei commented 4 years ago

I use 'pip install neovim-remote' on ubuntu 20.04 to install this support

It shows :

Using cached neovim-remote-2.1.0.tar.gz (10 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1LaZG_/neovim-remote/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1LaZG_/neovim-remote/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-v9DFvr
         cwd: /tmp/pip-install-1LaZG_/neovim-remote/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-1LaZG_/neovim-remote/setup.py", line 6, in <module>
        with open(path.join(here, 'README.md'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
bertilow commented 4 years ago

This started happening for me as well today with neovim nightly v0.5.0-571-g721f69c4a. It suddenly claims "nvr executable is not found, run pip install neovim-remote to install", but all attempts to install it run into this bug.

devilyouwei commented 4 years ago

This started happening for me as well today with neovim nightly v0.5.0-571-g721f69c4a. It suddenly claims "nvr executable is not found, run pip install neovim-remote to install", but all attempts to install it run into this bug.

Same, I am using Neovim(latest version) too, I don't know how to install neovim-remote

bertilow commented 4 years ago

Now that I look closer I see that "neovim-remote" is written in Python 3, but the command we're supposed to use to install it is "pip install neovim-remote" which is Python 2! The error message says that "'encoding' is an invalid keyword argument for this function" which is true for Python 2 but false for Python 3.

If I do "pip3 install neovim-remote" I get "Requirement already satisfied". Fine. But Neovim complains that "nvr executable is not found, run pip install neovim-remote to install". So what is actually happening here? Why is Python 2 in any way part of this? Python 2 is end-of-life. (I've never used Python 2 and never will.)

Update: It seems to me that this is a problem in the Neovim plugin floaterm. When doing "checkhealth" that plugin reports "nvr executable is not found, run pip install neovim-remote to install", but everything seems to work at it should since "neovim-remote" is actually there but installed with "pip3" and Python 3 as it should be.

devilyouwei commented 4 years ago

I found this issue too, I installed pip3 nvr, but checkhealth can't find this plugin. it still shows no nvr....I think I may report this to floatterm, before I report, I will update the vim-plugins first to make sure the new floaterm has this issue

bertilow commented 4 years ago

The problem went away when I added the location of nvr to my PATH.

In "/etc/environment" I added "/home/MYUSERNAME/.local/bin" and restarted.

nvr is supposed to install into "/usr/local/bin/" but somehow it didn't. So "checkhealth" couldn't find it.

And the correct command to install it is "pip3 install neovim-remote", not "pip ..." (unless you've changed pip to point to pip3).