Skip to content
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

Python3 provider can not work in nvchad #1417

Closed
BoostQ opened this issue Aug 3, 2022 · 6 comments
Closed

Python3 provider can not work in nvchad #1417

BoostQ opened this issue Aug 3, 2022 · 6 comments

Comments

@BoostQ
Copy link

BoostQ commented Aug 3, 2022

Describe the bug
Can not use python3 provider and related plugins in nvchad.

## 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 = "/usr/local/opt/python@3.7/bin/python3"
  - INFO: Executable: /usr/local/opt/python@3.7/bin/python3
  - INFO: Python version: 3.7.13
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

However,I installed python3 and pynvim package and I'm sure I set the right path.

To Reproduce

  1. install nvchad
  2. enable python3 provider vim.g.loaded_python3_provider = 1 (I override it in custom/init.lua). fix: providers are not disabled #1282
-- example file i.e lua/custom/init.lua
-- load your options globals, autocmds here or anything .__.
-- you can even override default options here (core/options.lua)

vim.g.loaded_python3_provider = 1
vim.g.python3_host_prog = "/usr/local/opt/python@3.7/bin/python3"`
  1. Run :checkhealth provider in nvim
## 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 = "/usr/local/opt/python@3.7/bin/python3"
  - INFO: Executable: /usr/local/opt/python@3.7/bin/python3
  - INFO: Python version: 3.7.13
  - INFO: pynvim version: 0.4.3
  - OK: Latest pynvim is installed.

Expected behavior

Let it work properly.

Desktop (please complete the following information):

  • Operating System : macOS 12.5 Monterey
  • Terminal: iTerm 2 Build 3.4.16
  • Version of Neovim :
    NVIM v0.7.2
    Build type: Release
    LuaJIT 2.1.0-beta3

Additional context

I Checked this in terminal

which python3
/usr/local/opt/python@3.7/bin/python3

which pip
/usr/local/opt/python@3.7/bin/pip
pip list
Package                Version
---------------------- -------
antlr4-python3-runtime 4.7.2
click                  8.1.3
Flask                  2.1.3
greenlet               1.1.2
importlib-metadata     4.12.0
itsdangerous           2.1.2
Jinja2                 3.1.2
latex2sympy2           1.7.8
MarkupSafe             2.1.1
mpmath                 1.2.1
msgpack                1.0.4
pip                    22.0.4
pynvim                 0.4.3
setuptools             60.10.0
sympy                  1.10.1
typing_extensions      4.3.0
Werkzeug               2.2.0
wheel                  0.37.1
zipp                   3.8.1
@siduck
Copy link
Member

siduck commented Aug 3, 2022

because its disabled by default in the options file, just enable it

@siduck siduck closed this as completed Aug 3, 2022
@siduck
Copy link
Member

siduck commented Aug 3, 2022

local enable_providers = {
      "python3_provider",
      "node_provider",
      -- and so on
    }
    
    for _, plugin in pairs(enable_providers) do
      vim.g["loaded_" .. plugin] = nil
      vim.cmd("runtime " .. plugin)
    end

@BoostQ
Copy link
Author

BoostQ commented Aug 3, 2022

It works! Thanks a lot for your help. @siduck

@martin-braun
Copy link

Okay, I had the same trouble. The key part is to set vim.g.loaded_python3_provider to nil and not to 1.

@coderprem
Copy link

in which file do I have to add:

local enable_providers = {
"python3_provider",
"node_provider",
-- and so on
}

for _, plugin in pairs(enable_providers) do
  vim.g["loaded_" .. plugin] = nil
  vim.cmd("runtime " .. plugin)
end

@siduck
Copy link
Member

siduck commented Jul 25, 2023

@coderprem custom init.lua or any file that gets loaded in custom init.lua

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants