szymonmaszke / vimpyter

Edit your Jupyter notebooks in Vim/Neovim
MIT License
333 stars 17 forks source link

No text on open notebook #26

Open ando600 opened 3 years ago

ando600 commented 3 years ago

Hi, I have vimpyter installed on both vim and nvim, and I have notedown version 1.5.1 installed. However, when I open a jupyter notebook, I see nothing in the vim terminal, and zc /zo doesnt find any closed folds. Below is a screenshot of the jupyter notebook and my vim teriminal. Do I need to configure the notedown in some way? Thanks,

Andrew

Screenshot_2021-04-13_10-52-51

uwla commented 3 years ago

same thing here

gitgurra commented 3 years ago

Same here. Haven't tried to do any major debugging but my installation seems correct.

E:

Using VIM 8.2 on Pop!_OS 20.10 and notedown 1.5.1

bmedicke commented 3 years ago

I have the same issue with both Vim 8.2.2029 and NeoVim 0.4.4.

p-sgarbi commented 3 years ago

Vim 8.2 and Notedown 1.5.1 on macOS, same issue... Pretty sure this isn't an authoritative solution as it feels super kludgey, but it worked for me 🤷‍♀️

I tried running notedown standalone and it barfed an error that ended like this:

$ notedown --from notebook --to markdown -o test.md test.ipynb
...
  File "/opt/miniconda3/share/jupyter/nbconvert/templates/compatibility/display_priority.tpl", line 2, in top-level template code
    {%- extends 'display_priority.j2' -%}
jinja2.exceptions.TemplateNotFound: ../base/display_priority.j2

This also resulted in an empty test.md file. So I went to /opt/miniconda3/share/jupyter/nbconvert/templates/compatibility/display_priority.tpl, which looked like this:

{{ resources.deprecated("This template is deprecated, please use base/display_priority.j2") }}
{%- extends 'display_priority.j2' -%}

And I changed the path in the extends to include the base dir, viz.:

...
{%- extends 'base/display_priority.j2' -%}

And now I can vim into test.ipynb – it works fine and looks beautiful.

paalge commented 3 years ago

@p-sgarbi Thank you that worked, though this looks like an issue with nbconvert?

grchristensen commented 3 years ago

For anyone else who comes across this issue the notedown problem is mentioned in https://github.com/aaren/notedown/issues/95. Since the breaking change comes from nbconvert v6, another easy way to fix this is to downgrade your installation of nbconvert after you have installed notedown:

pip install nbconvert==5.*

After this you should find that notedown works properly and vimpyter will be able to convert notebooks to markdown to display in the terminal.