如何为通过 flatpak 安装的 Neovim 启用 python 提供程序?

如何为通过 flatpak 安装的 Neovim 启用 python 提供程序?

我是新手flatpak所以我确实不知道它究竟是如何工作的。

我尝试使用 在我的本机系统上安装 python3apt并使用 进行安装pynvimpip3 install --user --upgrade pynvim(我在使用时这样做了snap,完全没问题)

但是我的 neovim 似乎仍然无法让提供程序工作。以下是我的健康检查结果。

## Python 3 provider (optional)
  - INFO: Disabled (g:loaded_python3_provider=1).  This might be due to some previous error.
  - WARNING: No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
  - ERROR: Python provider error:
    - ADVICE:
      - provider/pythonx: Could not load Python 3:
          /usr/bin/python3 does not have the "neovim" module. :help |provider-python|
          /usr/bin/python3.7 does not have the "neovim" module. :help |provider-python|
          python3.6 not found in search path or not executable.
          python3.5 not found in search path or not executable.
          python3.4 not found in search path or not executable.
          python3.3 not found in search path or not executable.
          /usr/bin/python is Python 2.7 and cannot provide Python 3.
  - INFO: Executable: Not found

编辑1:

我在这方面取得了一些进展。我发现neovimflatpak 应用程序已host启用,因此我可以通过 访问我的本机 python3 可执行文件/var/run/host/usr/bin/python3。但是,python3 所依赖的所有内容的路径都需要在前面加上/var/run/host/,但这仍然没有发生。这是新的健康检查消息。

## Python 3 provider (optional)
  - INFO: Disabled (g:loaded_python3_provider=1).  This might be due to some previous error.
  - INFO: Using: g:python3_host_prog = "/var/run/host/usr/bin/python3"
  - INFO: Executable: /var/run/host/usr/bin/python3
  - ERROR: Command error (job=5, exit code 1): `'/var/run/host/usr/bin/python3' -c 'import sys; print(".".join(str(x) for x in sys.version_info[:3]))'` (in '/home/haowenl/.var/app/io.neovim.nvim/config/nvim')
    Output: /var/run/host/usr/bin/python3: /usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /var/run/host/usr/bin/python3)
    Stderr: /var/run/host/usr/bin/python3: /usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /var/run/host/usr/bin/python3)
  - ERROR: Command error (job=6, exit code 1): `'/var/run/host/usr/bin/python3' -c 'import sys; sys.path.remove(""); import neovim; print(neovim.__file__)'` (in '/home/haowenl/.var/app/io.neovim.nvim/config/nvim')
    Output: /var/run/host/usr/bin/python3: /usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /var/run/host/usr/bin/python3)
    Stderr: /var/run/host/usr/bin/python3: /usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /var/run/host/usr/bin/python3)
  - WARNING: Unexpected Python version. This could lead to confusing error messages.
  - WARNING: Python 3.3+ is recommended.
  - INFO: Python version: /var/run/host/usr/bin/python3: /usr/lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by /var/run/host/usr/bin/python3)
  - 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

谢谢你!

相关内容