kaihowl / dotfiles

@kaihowl does dotfiles
MIT License
5 stars 0 forks source link

pynvim broken with python 3.12 #703

Closed KaiHoewelmeyer-TomTom closed 10 months ago

KaiHoewelmeyer-TomTom commented 10 months ago

Since some work tooling is also broken with python 3.12, install python 3.11 by default.

Once https://github.com/neovim/pynvim/issues/538 and the work tooling is fixed, upgrade to 3.12 and later again.

kaihowl commented 10 months ago

Checking in more detail: pynvim seems to be unused (plugins/other code). Will instead "fix" the issue by disabling the python/python3 provider altogether.

slacksystem commented 9 months ago

I'm sorry but I'm having trouble wiht this still. After launching neoivm with my virtualenv (called pyenv)

(pynvim) ~  > pip install 'pynvim @ git+https://github.com/neovim/pynvim'

pipi='pip install'
Collecting pynvim@ git+https://github.com/neovim/pynvim
  Cloning https://github.com/neovim/pynvim to /tmp/pip-install-n0z9krus/pynvim_b42a40d5d77c41389180500b9eb5e358
  Running command git clone --filter=blob:none --quiet https://github.com/neovim/pynvim /tmp/pip-install-n0z9krus/pynvim_b42a40d5d77c41389180500b9eb5e358
  Resolved https://github.com/neovim/pynvim to commit 169673714fd6d9f8bf53ed5ec55b9b01be5f560e
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: msgpack>=0.5.0 in ./.pyenv/versions/pynvim/lib/python3.12/site-packages (from pynvim@ git+https://github.com/neovim/pynvim) (1.0.7)
Requirement already satisfied: greenlet>=3.0 in ./.pyenv/versions/pynvim/lib/python3.12/site-packages (from pynvim@ git+https://github.com/neovim/pynvim) (3.0.1)
Building wheels for collected packages: pynvim
  Building wheel for pynvim (pyproject.toml) ... done
  Created wheel for pynvim: filename=pynvim-0.5.0.dev0-py2.py3-none-any.whl size=45152 sha256=184ea39a7bbec6ab0c64a8e9b22384a8b27d5478683045894a61f7177d780299
  Stored in directory: /tmp/pip-ephem-wheel-cache-5ia1gm3q/wheels/ed/e4/03/32c78f104e48c5c2f0353dcc1ef88cc58a4e8c3a21f41a3165
Successfully built pynvim
Installing collected packages: pynvim
  Attempting uninstall: pynvim
    Found existing installation: pynvim 0.5.0.dev0
    Uninstalling pynvim-0.5.0.dev0:
      Successfully uninstalled pynvim-0.5.0.dev0
Successfully installed pynvim-0.5.0.dev0                                                                                  /4.5s

Launching nvim (Lunarvim, if it matters) with environment active:

:echo g:python_host_prog
/home/<user>/.pyenv/version/pynvim/bin/python

Relevant section of :checkhealth provider:

Python 3 provider (optional) ~
- pyenv: Path: /home/slack/.pyenv/libexec/pyenv
- pyenv: Root: /home/slack/.pyenv
- WARNING No Python executable found that can `import neovim`. Using the first available executable for diagnostics.
- WARNING Could not load Python 3:
  /home/slack/.pyenv/shims/python3 is Python <string>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec() instead
  3.12 and cannot provide Python 3.
  /usr/bin/python3.10 does not have the "neovim" module.
  python3.9 not found in search path or not executable.
  python3.8 not found in search path or not executable.
  python3.7 not found in search path or not executable.
  /home/slack/.pyenv/shims/python is Python <string>:1: DeprecationWarning: 'pkgutil.get_loader' is deprecated and slated for removal in Python 3.14; use importlib.util.find_spec() instead
  3.12 and cannot provide Python 3.
  - ADVICE:
    - See :help |provider-python| for more information.
    - You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim
- Executable: Not found

Python virtualenv ~
- WARNING $VIRTUAL_ENV is set to: /home/slack/.pyenv/versions/3.12.0/envs/pynvim
  And its /bin directory contains: python, python3, python3-config, python3.12, python3.12-config
  But $PATH yields this python executable: /home/slack/.pyenv/versions/pynvim/bin/python
  And $PATH in subshells yields this python executable: /home/slack/.pyenv/versions/pynvim/bin/python
  And $PATH yields this python3 executable: /home/slack/.pyenv/versions/pynvim/bin/python3
  And $PATH in subshells yields this python3 executable: /home/slack/.pyenv/versions/pynvim/bin/python3
  And $PATH yields this python3-config executable: Usage: /home/slack/.pyenv/versions/pynvim/bin/python3-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed

  And $PATH in subshells yields this python3-config executable: Usage: /home/slack/.pyenv/versions/pynvim/bin/python3-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed

  And $PATH yields this python3.12 executable: /home/slack/.pyenv/versions/pynvim/bin/python3.12
  And $PATH in subshells yields this python3.12 executable: /home/slack/.pyenv/versions/pynvim/bin/python3.12
  And $PATH yields this python3.12-config executable: Usage: /home/slack/.pyenv/versions/pynvim/bin/python3.12-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed

  And $PATH in subshells yields this python3.12-config executable: Usage: /home/slack/.pyenv/versions/pynvim/bin/python3.12-config --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed

  So invoking Python may lead to unexpected results.
  - ADVICE:
    - $PATH ambiguities arise if the virtualenv is not properly activated prior to launching Nvim. Close Nvim, activate the virtualenv, check that invoking Python from the command line launches the correct one, then relaunch Nvim.
    - $PATH ambiguities in subshells typically are caused by your shell config overriding the $PATH previously set by the virtualenv. Either prevent them from doing so, or use this workaround: https://vi.stackexchange.com/a/34996

I'm not sure what I might have done wrong to have it working for everyone else and not for me, but does someone have an idea of how to fix this? If I can provide any more info that would be helpful please let me know.

slacksystem commented 9 months ago

Oops I'm so sorry I thought this was the pynvim repo. Disregard