74

How do you update jupyterlab using conda or pip?

I understand that conda update jupyter updates jupyter notebook (I have Anaconda), but I'm not sure this takes care of jupyterlab as well.

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
a06e
  • 18,594
  • 33
  • 93
  • 169

6 Answers6

90

conda update jupyter will not automatically update jupyterlab. You have to explicitly request an update of jupyterlab:

conda update jupyterlab
cel
  • 30,017
  • 18
  • 97
  • 117
  • 50
    Alternative: ```pip install --upgrade jupyterlab``` – Stefan van Gastel Aug 30 '19 at 14:33
  • 2
    Do NOT use ```pip install --upgrade jupyterlab``` in a conda environment where jupyterlab was installed with conda, unless you plan to "dead-end" that conda environment (or possibly corrupt it permanently). For more information, see https://www.anaconda.com/blog/using-pip-in-a-conda-environment – Rich Lysakowski PhD Sep 25 '22 at 00:56
  • Hi I used this approach, then I found the version I installed is 3.3.2. However in below anaconda website the version is 3.5.0. How do I upgrade it to 3.5.0? Thanks https://anaconda.org/conda-forge/jupyterlab – roudan Oct 30 '22 at 19:38
32

You may need to specify conda-forge:

conda update -c conda-forge jupyterlab

EDIT: Trying to update to 3.0, conda update jupyterlab did not work for me (result of jupyter lab --version still was 2.x) and when I tried to specify conda-forge or jupyterlab=3.0 the command hung for too long. I gave up after almost an hour of solving environment. The following worked for me from the Anaconda shell:

conda uninstall jupyterlab
conda install -c conda-forge jupyterlab=3
elz
  • 5,338
  • 3
  • 28
  • 30
21

I was getting frustrated by trying to update Jupyterlab on Anaconda and failing. Eventually I realized that this line of code works for me:

    conda update --all

enter image description here

Lamanus
  • 12,898
  • 4
  • 21
  • 47
Justin
  • 211
  • 2
  • 2
  • 3
    In fact `conda update --all` is a good to refresh and update the entire environment before upgrading a major package like JupyterLab, Jupyter Classic NB, or Spyder so that all the supporting packages are up-to-date before doing your update. This can help to repair the conda package index caused by packages inadvertently installed using pip into the conda environment. – Rich Lysakowski PhD Apr 07 '21 at 04:10
18

If you prefer using pip:

pip install --upgrade jupyterlab

Or if you'd like a specific version:

pip install jupyterlab==1.2.4

Depending on your rights, you might also need to add a --user in there:

pip install jupyterlab==1.2.4 --user
vestland
  • 55,229
  • 37
  • 187
  • 305
  • 1
    Do NOT use pip install --upgrade jupyterlab in a conda environment where jupyterlab was installed with conda, unless you plan to "dead-end" that conda environment (or possibly corrupt it permanently). For more information, see anaconda.com/blog/using-pip-in-a-conda-environment – Rich Lysakowski PhD Sep 25 '22 at 00:56
3

Experience has taught me, that when you need to upgrade multiple pip packages, the best way is to do it all at once (pip will find a good combination of versions and requirements).

So what I did is this.

  1. Figure out what jupyterlab uses (your output may differ):
$ jupyter --version
Selected Jupyter core packages...
IPython          : 8.9.0
ipykernel        : 6.20.2
ipywidgets       : 8.0.4
jupyter_client   : 8.0.1
jupyter_core     : 5.1.5
jupyter_server   : 2.1.0
jupyterlab       : 3.5.3
nbclient         : 0.7.2
nbconvert        : 7.2.9
nbformat         : 5.7.3
notebook         : 6.5.2
qtconsole        : 5.4.0
traitlets        : 5.8.1

  1. Put all those in a single line and run --upgrade:
$ pip install --upgrade IPython ipykernel  ipywidgets jupyter_client jupyter_core jupyter_server jupyterlab nbclient nbconvert nbformat notebook qtconsole traitlets  

All went smoothly.

Rub
  • 2,071
  • 21
  • 37
1

After a lot of back-and-forth with the above methods with conda, none of which worked for me to upgrade nodejs to > v14.x - below is the solution that worked for me, thanks to the link below:

  1. conda search nodejs # Search nodejs version under conda.
  2. conda install nodejs=14.7.0 -c conda-forge

https://www.programmersought.com/article/39027053707/

Soliton
  • 11
  • 1