jwkvam / jupyterlab-vim

:neckbeard: Vim notebook cell bindings for JupyterLab
MIT License
973 stars 73 forks source link

This extension does not yet support the current version of JupyterLab. #87

Closed idvorkin closed 5 years ago

idvorkin commented 5 years ago

jupyterlab_vim stopped working on the latest. What can I do to help debug?

(jupyter) ➜  jupyter git:(master) ✗ jupyter-lab --version
1.0.0
(jupyter) ➜  jupyter git:(master) ✗ jupyter labextension install jupyterlab_vim

An error occured.
ValueError: This extension does not yet support the current version of JupyterLab.

Conflicting Dependencies:
JupyterLab              Extension      Package
>=1.0.0 <2.0.0          >=0.19.1 <0.20.0@jupyterlab/application
>=1.0.0 <2.0.0          >=0.19.1 <0.20.0@jupyterlab/notebook
See the log file for details:  /var/folders/tl/nmzk32m95_37fznfpg4gbj0j_fply8/T/jupyterlab-debug-m4hjrnl5.log

From the log file

npm notice === Tarball Details ===
npm notice name:          jupyterlab_vim
npm notice version:       0.10.1
npm notice filename:      jupyterlab_vim-0.10.1.tgz
npm notice package size:  6.7 kB
npm notice unpacked size: 29.8 kB
npm notice shasum:        6b7db06ff1e75d58264b1d3094309c9c19483abe
npm notice integrity:     sha512-qmoSsRJMN+CF7[...]V2x5KHfiIK9OA==
npm notice total files:   7
npm notice
jupyterlab_vim-0.10.1.tgz

Fetching URL: https://registry.npmjs.org/jupyterlab_vim
Fetching URL: https://registry.npmjs.org/jupyterlab_vim
Traceback (most recent call last):

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 82, in start
    ans = self.run_task()

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 103, in run_task
    for arg in self.extra_args

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 103, in <listcomp>
    for arg in self.extra_args

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/commands.py", line 316, in install_extension
    return handler.install_extension(extension)

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/commands.py", line 517, in install_extension
    info = self._install_extension(extension, tempdir)

  File "/Users/idvorkin/.local/share/virtualenvs/jupyter-ojjAUlJq/lib/python3.7/site-packages/jupyterlab/commands.py", line 1416, in _install_extension
    raise ValueError(msg)

ValueError: This extension does not yet support the current version of JupyterLab.

Conflicting Dependencies:
JupyterLab              Extension      Package
>=1.0.0 <2.0.0          >=0.19.1 <0.20.0@jupyterlab/application
>=1.0.0 <2.0.0          >=0.19.1 <0.20.0@jupyterlab/notebook

Exiting application: jupyter
zaneselvans commented 5 years ago

Would also love to see this extension updated for Jupyter 1.0. I feel lost in my notebooks without it!

idvorkin commented 5 years ago

Started but didn't get very far with #88

dirkroorda commented 5 years ago

I forked and checked whether it works regardless of the version. It did not. A real change has to be made.

idvorkin commented 5 years ago

FYI - I ended up pinning my version of jupyter-lab to avoid losing vim compatibility. I'm not sure what depends on jupyter-lab 1.0 thought:

jupyterlab  = "==0.35.6"  # Pin jupyter lab till vim is compatible
benlindsay commented 5 years ago

@idvorkin Out of curiosity, why/where do you use the syntax jupyterlab = "==0.35.6"? I've only seen it like jupyterlab==0.35.6 in requirements.txt or environment.yml

idvorkin commented 5 years ago

@benlindsay It's from a Pipfile used by pipenv. Pipenv is awesome in theory, except it's really sloooow in practice.

remiOdite commented 5 years ago

Hi ! I just installed jupyterlab, and I get the same error when I'm trying to add this extension. Is there any other solution than removing the pinning of the jupyterlab version ?

wiseyoungbuck commented 5 years ago

I can't believe how dependent on this extension I am. I'm really looking forward to this issue being resolved :).

zaneselvans commented 5 years ago

Me too... though I'm concerned we may need to figure out how to fix it on our own, as @jwkvam has hardly been active at all on Github since the last time the plugin was updated in November of last year. Has anybody else here worked on jupyterlab extensions before?

dirkroorda commented 5 years ago

It seems that the API that Jupyterlab offers to javascript libraries that operate on code cells has changed considerably when going to version 1.0.0. The vim bindings in this extension is really a vim-like editor based on codemirror. The work that has to be done is to re-glue the codemirror library to the jupyter code cell. I guess it is mainly a matter of renaming interfaces and functions in the API. Easy if you have written the code, far from trivial if you see it for the first time.

ryantam626 commented 5 years ago

I can look into fixing it on Monday (vacation until then) if no one has done it by then

willprice commented 5 years ago

It appears the CodeMirror vim keymap is now lazy loaded in JupyterLab. Previously it was always imported which this addon has relied on when setting the current cell's keymap. By importing the keymap in the addon, we ensure it's loaded before setting the keymap of a cell thereby resolving the issue.

I've got a branch up over at https://github.com/willprice/jupyterlab-vim/tree/alpha1 which fixes this. Let me know if you have any issues.

To install...

$ git clone https://github.com/willprice/jupyterlab-vim.git
$ cd jupyterlab-vim
$ git checkout alpha1
$ jupyter labextension uninstall jupyterlab_vim
$ jlpm install
$ jlpm run build
$ jupyter labextension link .
$ jupyter labextension enable jupyterlab_vim

And run jupyter lab.

If you have any issues, please open up the browser console and copy and paste any stacktraces.

zaneselvans commented 5 years ago

Yay! It seems to work fine for me (on jupyterlab 1.0.2) Thank you so much for debugging this.

willprice commented 5 years ago

@zaneselvans thanks for the confirmation it works :) it was fairly easy to debug once I'd figured out how extensions work in jupyterlab.

louison commented 5 years ago

Hi @zaneselvans, It works for me on jupyterlab (1.02) within docker 👌. Thank you very much

dirkroorda commented 5 years ago

@willprice Installation instructions worked and the result is: working vim bindings as before. This is on Macos with a vanilla Python 3.7.3 and pip3-installed Jupyterlab. Many thanks!

caadr commented 5 years ago

Thanks a lot @willprice!

In ~8h of working with your patched version, i did not notice any issues.

Ubuntu 18.04, conda env with python 3.7.1, jupyter lab 1.0.2

remiOdite commented 5 years ago

Also works for me ! Thanks a lot @willprice !

jwkvam commented 5 years ago

Sorry all for being absent.

Thanks for the fix @willprice I'll take a look at your pull request tonight, merge it and make a release.

I should probably find ways for others to help with maintenance as I'm not giving this project the attention it needs.

On Mon, Jul 15, 2019, 4:14 AM remiOdite notifications@github.com wrote:

Also works for me ! Thanks a lot @willprice https://github.com/willprice !

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jwkvam/jupyterlab-vim/issues/87?email_source=notifications&email_token=AAAVCIGYYOF3R5WGLXL5WVLP7RLXTA5CNFSM4H4NTRZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ5MDJQ#issuecomment-511361446, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAVCIDUUU4ZVK57Y6AVAWTP7RLXTANCNFSM4H4NTRZQ .

jwkvam commented 5 years ago

The new version has been pushed to npm. https://www.npmjs.com/package/jupyterlab_vim/v/0.11.0

This is identical to the PR willprice opened if you were using that. Upgrade with:

jupyter labextension install jupyterlab_vim
yelled1 commented 5 years ago

Hi:

I uninstalled & installed $jupyter labextension (un)install jupyterlab_vim. How do I know I am getting from your repository rather than willprice clone, which I downloaded & followed. Also, how do reverse or remove $jlpm install? Do I just $rm -rf the git clone, after I uninstall? Likely, but just wanted to make sure. Thanks much,

S. H.

On Tue, Jul 16, 2019 at 12:43 AM Jacques Kvam notifications@github.com wrote:

The new version has been pushed to npm. https://www.npmjs.com/package/jupyterlab_vim/v/0.11.0

This is identical to the PR willprice opened if you were using that. Upgrade with:

jupyter labextension install jupyterlab_vim

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jwkvam/jupyterlab-vim/issues/87?email_source=notifications&email_token=AARVDVVDLOC2HDW2H2DUALTP7VGWZA5CNFSM4H4NTRZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ7VUAA#issuecomment-511662592, or mute the thread https://github.com/notifications/unsubscribe-auth/AARVDVWYSZD2ME4C7TPJ3XDP7VGWZANCNFSM4H4NTRZQ .

jwkvam commented 5 years ago

"jupyter labextension install" looks for packages in npm if IIUC. So it get's it from https://www.npmjs.com/package/jupyterlab_vim

I think doing uninstall would work. You can double check that you have the intended version with "jupyter labextension list". You should see something like this:

JupyterLab v1.0.2 Known labextensions: app dir: /Users/jacques/miniconda/share/jupyter/lab @jupyter-widgets/jupyterlab-manager v1.0.1 enabled OK @jupyter-widgets/jupyterlab-sidecar v0.4.0 enabled OK jupyterlab_vim v0.11.0 enabled OK* nbdime-jupyterlab v0.6.0 enabled X

On Tue, Jul 16, 2019 at 9:13 AM S H Yoon notifications@github.com wrote:

Hi:

I uninstalled & installed $jupyter labextension (un)install jupyterlab_vim. How do I know I am getting from your repository rather than willprice clone, which I downloaded & followed. Also, how do reverse or remove $jlpm install? Do I just $rm -rf the git clone, after I uninstall? Likely, but just wanted to make sure. Thanks much,

S. H.

On Tue, Jul 16, 2019 at 12:43 AM Jacques Kvam notifications@github.com wrote:

The new version has been pushed to npm. https://www.npmjs.com/package/jupyterlab_vim/v/0.11.0

This is identical to the PR willprice opened if you were using that. Upgrade with:

jupyter labextension install jupyterlab_vim

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/jwkvam/jupyterlab-vim/issues/87?email_source=notifications&email_token=AARVDVVDLOC2HDW2H2DUALTP7VGWZA5CNFSM4H4NTRZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ7VUAA#issuecomment-511662592 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AARVDVWYSZD2ME4C7TPJ3XDP7VGWZANCNFSM4H4NTRZQ

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jwkvam/jupyterlab-vim/issues/87?email_source=notifications&email_token=AAAVCIC5VYNBDXRQI6E7A33P7XXRDA5CNFSM4H4NTRZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2BLV2A#issuecomment-511884008, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAVCIG7D5SZ2QGYTSAFD3DP7XXRDANCNFSM4H4NTRZQ .

dirkroorda commented 5 years ago

I uninstalled from the extensions tab on the jupyterlab sidebar. That worked. Then I installed from the same bar. And that got me the update by jwkvam.

sid-kap commented 4 years ago

Seems like the extension now doesn't support JupyterLab v2 (specifically jupyterlab==2.1.0). Does anyone know what it would take to make it work with v2? Have the APIs changed significantly, or would it be as simple as changing the bounds in package.json?

louison commented 4 years ago

Hi all, Currently, there no release on a major branch for a v2 support but a merge request is pending. I managed to get the plugin to work by following the instructions here: https://github.com/jwkvam/jupyterlab-vim/pull/115#issuecomment-605525296

I hop it will help you