benlubas/molten-nvim

[Help] How to set up Python 3 provider

Closed this issue · 9 comments

I am trying to get set up using molten-nvim but I seem to be missing a step for configuring Python and neovim because my Python 3 provider is not set. I am using a virtual environment and this is the output from :checkhealth provider:

provider: health#provider#check

Clipboard (optional) ~
- OK Clipboard tool found: xsel

Python 3 provider (optional) ~
- Disabled (g:loaded_python3_provider=0).

Python virtualenv ~
- $VIRTUAL_ENV is set to: /home/henry/workspace/ncapi/env
- Python version: 3.10.12
- OK $VIRTUAL_ENV provides :!python.

Ruby provider (optional) ~
- Disabled (g:loaded_ruby_provider=0).

Node.js provider (optional) ~
- Disabled (g:loaded_node_provider=0).

Perl provider (optional) ~
- Disabled (g:loaded_perl_provider=0).

When I run :checkhealth molten I get this:

molten: require("molten.health").check()

molten-nvim ~
- OK NeoVim >=0.9
- ERROR molten-nvim requires a Python provider to be configured!

I must be missing something very basic! I have pynvim installed in the virtual environment, was following the getting started guide.

I would appreciate any suggestions!

should be on by default, can you link your config? You must be disabling it somewhere, we can find it.

I just added my config to a repo: https://github.com/hrodmn/nvim

init.lua sources myinit.lua which sets vim.g.python3_host_prog but that doesn't seem to be taking effect.

@hrodmn did that fix everything?

Unfortunately it did not fix everything - I think it helped since I can see that the molten actions are available now, but I am still not getting a Python 3 provider. Maybe one of the other disabled plugins is breaking things.

I will try commenting out the whole list of disabled plugins and try to identify the culprit(s).

Definitely share results. I might make an FAQ doc with a bunch of common setup issues. There are a few now

I have a similar issue but on Windows, I set the vim.g.python3_host_prog to a dedicated env, but the checkhealth fails, I think it will be useful to add where it found the installation that uses.
Where can I find the bin that uses?

Here the report:

molten-nvim ~
- OK NeoVim >=0.9
- OK Python >=3.10
- OK Python module pynvim found
- ERROR Required python module jupyter-client not found
  - ADVICE:
    - pip install jupyter-client
- WARNING Optional python module cairosvg not found
  - ADVICE:
    - pip install cairosvg
- WARNING Optional python module pnglatex not found
  - ADVICE:
    - pip install pnglatex
- WARNING Optional python module plotly not found
  - ADVICE:
    - pip install plotly
- WARNING Optional python module kaleido not found
  - ADVICE:
    - pip install kaleido
- WARNING Optional python module pyperclip not found
  - ADVICE:
    - pip install pyperclip
- WARNING Optional python module nbformat not found
  - ADVICE:
    - pip install nbformat
- WARNING Optional python module pillow not found
  - ADVICE:
    - pip install pillow

But the setted environment has Jupiter:

❯ pip list | Select-String jup

jupyter                   1.0.0
jupyter_client            8.6.2
jupyter-console           6.6.3
jupyter_core              5.7.2
jupyter-events            0.10.0
jupyter-lsp               2.2.5
jupyter_server            2.14.1
jupyter_server_terminals  0.5.3
jupyterlab                4.2.1
jupyterlab_pygments       0.3.0
jupyterlab_server         2.27.2
jupyterlab_widgets        3.0.11
jupytext                  1.16.2

Here Mason and Python provider:


mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2024-06-02-silver-vicuna` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send
`
- WARNING wget: not available
  - ADVICE:
    - spawn: wget failed with exit code - and signal -. wget is not executable
- OK curl: `curl 8.7.1 (Windows) libcurl/8.7.1 Schannel zlib/1.3 WinIDN
`
- OK gzip: `gzip 1.10
`
- OK tar: `bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4 
`
- OK pwsh: `7.4.2 Microsoft Windows 10.0.22631 Win32NT
`
- OK 7z: `7-Zip 24.05 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-05-14
`

mason.nvim [Languages] ~
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer.bat failed with exit code - and signal -. composer.bat is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. ruby is not executable
- WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem.cmd failed with exit code - and signal -. gem.cmd is not executable
- OK Go: `go version go1.22.2 windows/amd64`
- OK node: `v20.3.1
`
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- OK cargo: `cargo 1.77.1 (e52e36006 2024-03-26)`
- OK python: `Python 3.12.3
`
- OK java: `openjdk version "11.0.22" 2024-01-16 LTS
`
- OK javac: `javac 11.0.22
`
- OK JAVA_HOME: `openjdk version "11.0.22" 2024-01-16 LTS
`
- OK pip: `pip 24.0 from C:\Users\andre\.pyenv\pyenv-win\versions\nvim_3.12.3\Lib\site-packages\pip (python 3.12)

`
- OK npm: `9.6.7`
- OK python venv: `Ok`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 1. Remaining: 59. Limit: 60. Reset: 02/06/2024 22:03:57.
  Install and authenticate via gh-cli to increase rate limit.

==============================================================================
provider.python: require("provider.python.health").check()

Python 3 provider (optional) ~
- pyenv: Path: C:\Users\andre\.pyenv\pyenv-win\bin\pyenv.BAT
- pyenv: Root: C:\Users\andre\.pyenv\pyenv-win\
- Using: g:python3_host_prog = "C:\Users\andre\.pyenv\pyenv-win\versions\nvim_3.12.3\python.exe"
- Executable: C:\Users\andre\.pyenv\pyenv-win\versions\nvim_3.12.3\python.exe
- Python version: 3.12.3
- pynvim version: 0.5.0
- OK Latest pynvim is installed.

Python virtualenv ~
- OK no $VIRTUAL_ENV

ok seems related with pyenv-win, because if I delete C:\Users\andre\AppData\Roaming\Python\Python312 the molten's checkhealth passes.

Ok I solved. If Neovim was installed using --user it appears on C:\Users\andre\AppData\Roaming\Python\Python312 so a solution is to do pip install --force --user jupiter-client
Or to make all clearer. Delete the Pyenv-win env. Create a new one install everything and then duplicate it.