• Post author:
  • Post category:Python
  • Post last modified:March 27, 2024
  • Reading time:5 mins read
You are currently viewing Update Jupyter Notebook or Jupyterlab

You can use the pip or conda to update or upgrade Jupyter Notebook or Jupyterlab to a specific version or the latest version. You can use these steps to upgrade Jupyter Notebook or Jupyterlab on Mac OS, Windows, and Linux-based OS.

Upgrade Jupyterlab using pip

Using pip to update Jupyterlab or Jupyter Notebook is a reliable and convenient choice due to its ease of use, and compatibility. It ensures that you have a well-maintained and up-to-date Jupyter environment for your data analysis, coding, and research needs. Before using pip, first upgrade pip and then upgrade the required package.

Note: If you have installed Jupyterlab with conda, do not use pip to upgrade instead use conda to upgrade.


# Upgrade pip
pip install --upgrade pip

# Update jupyterlab using pip
pip install --upgrade jupyterlab

# Using pip3
pip3 install --upgrade jupyterlab

Once the update completes, restart the Jupyter Notebook by closing the browser and starting Jupyter Lab to use the updated version.

If you want to install a specific Jupyter version use the below command.


# Update jupyterlab to specific version
pip install jupyterlab==1.2.4

Upgrade Jupyterlab using conda

If you are using Jupyterlab on Anaconda, you can use the conda command to update Jupyter Notebook to the latest version. conda is a command-line package and environment management system that is primarily associated with Anaconda and Miniconda, two popular distributions of Python and data science packages. Conda is used for creating, managing, and switching between different Python environments and for installing, updating, and managing software packages, including Python packages, libraries, and applications.


# Update jupyterlab using conda
conda update -c conda-forge jupyterlab

You can also uninstall and install the specific or latest version.


# Uninstall and install
conda uninstall jupyterlab
conda install -c conda-forge jupyterlab=3

Alternatively, you can also upgrade all packages in Conda in one go.


# Upgrade all packages
conda update --all

Update using Homebrew

Open your terminal and run the following command to update Homebrew to the latest version. In order to use this, you should have Jupyterlab installed with the brew command.


# Update brew
brew update

# Update jupyterlab
brew upgrade --cask jupyterlab

Update Jupyter Notebook

If you have Jupyter Notebook installed without Jupyterlab then follow the following steps to update Jupyter Notebook


# Upgrade Jupyter notebook
conda update notebook

# Using pip
pip install -U notebook

If you are running an older version of the IPython Notebook (version 3 or earlier) you can use the following to upgrade to the latest version of the Jupyter Notebook.


# Upgrade Jupyter notebook
conda update jupyter

# Using pip
pip install -U jupyter

Conclusion

In this article, you have learned different ways to upgrade or update the JupyterLab and Jupyter Notebook that runs the Jupyter Notebook. One of the most used approaches is by using the pip command however, if you have Jupyterlab installed with conda or brew then you need to use the respective equivalent commands to update it.

Naveen Nelamali

Naveen Nelamali (NNK) is a Data Engineer with 20+ years of experience in transforming data into actionable insights. Over the years, He has honed his expertise in designing, implementing, and maintaining data pipelines with frameworks like Apache Spark, PySpark, Pandas, R, Hive and Machine Learning. Naveen journey in the field of data engineering has been a continuous learning, innovation, and a strong commitment to data integrity. In this blog, he shares his experiences with the data as he come across. Follow Naveen @ LinkedIn and Medium