a06e
a06e

Reputation: 20774

How to update jupyterlab using conda or pip

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.

Upvotes: 87

Views: 190015

Answers (6)

Rub
Rub

Reputation: 2708

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.


Update 2024-08-01 : I found a situation where for some reason notebook was holding up the upgrade of the entire group.

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.

notebook 6.5.7 requires jupyter-client<8,>=5.3.4, but you have jupyter-client 8.6.2 which is incompatible.

The solution was to

# Uninstall it 
pip uninstall  notebook 

# Upgrade the whole group (except notebook)
pip install --upgrade IPython ipykernel  ipywidgets jupyter_client jupyter_core jupyter_server jupyterlab nbclient nbconvert nbformat  qtconsole traitlets 

# Install notebook
pip install  notebook 

Upvotes: 5

Soliton
Soliton

Reputation: 31

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/

Upvotes: 1

elz
elz

Reputation: 5698

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

Upvotes: 37

Justin
Justin

Reputation: 241

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

Upvotes: 24

vestland
vestland

Reputation: 61084

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

Upvotes: 25

cel
cel

Reputation: 31349

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

conda update jupyterlab

Upvotes: 107

Related Questions