jupyterlab-contrib / jupyterlab_code_formatter

A JupyterLab plugin to facilitate invocation of code formatters.
https://jupyterlab-code-formatter.readthedocs.io/
MIT License
854 stars 55 forks source link

Potential plugin version mismatch issue #119

Closed ryantam626 closed 2 years ago

ryantam626 commented 4 years ago

On upgrade of this plugin, you might see a plugin version mismatch error message.

Steps to solve this:

  1. Try to update the lab extension first with jupyter labextension update @ryantam626/jupyterlab_code_formatter
  2. Work out what version of the lab extension you have with jupyter labextension list | grep jupyterlab-code-formatter
  3. Install a matching server extension with pip install jupyterlab_code_formatter==x.x.x (replace x.x.x with version you observe in step 2
  4. Work out what version of the server plugin you have with pip freeze | grep jupyterlab-code-formatter and confirm it matches what you installed step 3 optionally
  5. Restart jupyterlab
devstein commented 4 years ago

@ryantam626 I trying to setup jupyterlab_code_formatter on Jupyterhub in K8s and am seeing the following error on login after adding it to the Docker image:

Juypterlab Code Formatter Error 
Unable to find server plugin version, consider upgrading.

Is this the same issue or different?

ryantam626 commented 4 years ago

@devstein looks similar at first glance but your setup is probably more complicated than most people, if you open a new issue I can debug with you over there :smile:

aarchiba commented 4 years ago

If you are installing with conda rather than pip, you can use

$ conda install -c conda-forge jupyterlab_code_formatter==1.1.0

to get a specific version.

mouradbelo commented 4 years ago

@ryantam626 I trying to setup jupyterlab_code_formatter on Jupyterhub in K8s and am seeing the following error on login after adding it to the Docker image:

Juypterlab Code Formatter Error 
Unable to find server plugin version, consider upgrading.

Is this the same issue or different?

@ryantam626 Same issue for me, using Jupyter lab on a remote cluster with ssh.

ryantam626 commented 4 years ago

@mouradbelo follow this this, open a new issue if it doesn't work out so I can follow up with you there :smiley:

b4dboi commented 4 years ago

Hi @ryantam626, I face the very same issue as @devstein and @mouradbelo do. I've installed the extension on top of the docker-stacks/pyspark-notebook and was not successful with the procedure described above. The JupyterLab in the docker container always starts with the extension already installed. May I check the versions somewhere else? This is my output:

xxx@xxx:~$ pip freeze | grep jupyterlab-code-formatter
jupyterlab-code-formatter==1.3.1
xxx@xxx:~$ jupyter labextension list
JupyterLab v2.1.3
Known labextensions:
   app dir: /opt/conda/share/jupyter/lab
        @ryantam626/jupyterlab_code_formatter v1.3.1  enabled  OK
ryantam626 commented 4 years ago

@b4dboi similar issues was observed before, doing jupyter serverextension enable --py jupyterlab_code_formatter --sys-prefix instead of jupyter serverextension enable --py jupyterlab_code_formatter usually fixes this if you are using docker

bilke commented 4 years ago

If you are on arch linux and you installed jupyterlab_code_formatter via systems package manager:

Check for the installed version:

$ pacman -Q jupyterlab_code_formatter
jupyterlab_code_formatter 1.3.1-1

And install exactly this version of the the labextension:

$ jupyter labextension install @ryantam626/jupyterlab_code_formatter@1.3.1
paw-lu commented 3 years ago

The mismatch error for me seems to be due to the fact that the package is at 1.3.8 on conda-forge while jupyter labextension update pushes it up to 1.4.1.

Any reason for this discrepancy?

ryantam626 commented 3 years ago

@paw-lu Don't use the conda-forge package right now, it's not updated just yet (I don't manage that). Just pip install should work now if you are using jupyterlab 3, feel free to look at more recent PR/issues for more context.