Install Jupyterlab on Ubuntu – Fast & Easy

Install Jupyterlab on Ubuntu

To install JupyterLab on Ubuntu, create a virtual environment and run pip install jupyterlab inside it, or run conda install -c conda-forge jupyterlab if you use Anaconda. Start it with jupyter lab and it opens in your browser. The current release is 4.6 and needs Python 3.10 or newer.

Short version

Terminalbash
sudo apt install -y python3-venv
python3 -m venv ~/jupyter-env
source ~/jupyter-env/bin/activate
pip install jupyterlab
jupyter lab

If you have followed our Install Anaconda on Ubuntu tutorial, chances are that you are also looking for a tutorial on how to Install Jupyterlab on Ubuntu. So, why not cover the whole thing? Let’s get right started.

There are 3 ways to Install Jupyterlab:

  1. Conda (that requires you to install Anaconda first, follow our Anaconda on Ubuntu tutorial to do so!)
  2. Pip
  3. Pipenv

I show you all 3 ways so you are covered.

Step 1 - Install Jupyterlab using Conda

Assuming you have Anaconda installed, simply run:

Terminalbash
conda install -c conda-forge jupyterlab

When prompted if you want to proceed with the installation, hit y.

Installation Process
Install Jupyterlab using Conda

That’s it for the Conda way. To learn how to start Jupyterlab continue with Step 4.

Step 2 - Install Jupyterlab using Pip

Recent Ubuntu releases refuse to install Python packages into the system Python with pip and show an externally-managed-environment error. The fix is a virtual environment. First install the venv package, then create and activate an environment:

Terminalbash
sudo apt install -y python3-venv
python3 -m venv ~/jupyter-env
source ~/jupyter-env/bin/activate

Now run the installer using Pip:

Terminalbash
pip install jupyterlab

Next time you open a terminal, run source ~/jupyter-env/bin/activate again before you start JupyterLab.

Install Jupyter Notebook
Install Jupyterlab using Pip

That’s all you need to do for the Pip install. If you install with pip install --user instead, make sure ~/.local/bin is on your PATH.

Step 3 - Install Jupyterlab using Pipenv

If you use Pipenv, run:

Terminalbash
pipenv install jupyterlab
pipenv shell

Or from a Git Checkout:

Terminalbash
pipenv install git+https://github.com/jupyterlab/jupyterlab.git#egg=jupyterlab
pipenv shell

Step 4 - Starting Jupyterlab

To start Jupyterlab you simply run it inside the environment you installed it in:

Terminalbash
jupyter lab
Install Jupyter Notebook
Starting Jupyterlab

After you run the command, a Web Browser automatically opens with the JupyterLab interface. The screenshots below are from an older release, so the current interface looks different.

Install Jupyter Notebook
Jupyter Notebook Web Interface

In case it doesn’t come up automatically, copy the http://localhost link that jupyter lab prints in your terminal into a Web Browser. It ends in /lab.

FAQ

Which Python version does JupyterLab need?

The current release, JupyterLab 4.6, needs Python 3.10 or newer. Check yours with python3 --version before you install.

Why does pip say “externally-managed-environment” on Ubuntu?

Your system Python is managed by Ubuntu’s package manager, so pip refuses to change it. Create a virtual environment with python3 -m venv and run pip install jupyterlab inside it, as shown in Step 2.

Why is the jupyter command not found after installing?

With pip install --user, the ~/.local/bin folder must be on your PATH. Add it with export PATH="$HOME/.local/bin:$PATH". With Pipenv, activate the project’s virtualenv first using pipenv shell, or run pipenv run jupyter lab.

Should I install JupyterLab with conda or pip?

Use conda if you already run Anaconda, because it keeps JupyterLab in the same environment manager as your other data science packages. Otherwise pip in a virtual environment is the lighter option. Both give you the same jupyter lab command.

Conclusion

You can achieve a complete setup of Jupyterlab in only a couple of steps. If you have followed the previous Anaconda installation tutorial, you should have no issue being up and running within 15 Minutes, all together. Jupyterlab is really interesting for Development, I am going to look into it myself and maybe even make more Tutorials for Jupyterlab in the future.

If you are interested in learning more about the Python programming language, check out some of the tutorials below.

🐍 Learn Python Programming 🔨 Python Basics
👉 Python Syntax 👉 Python Variables 👉 Python print() 👉 Python input() 👉 Python Constants 👉 Python Comments ⚙️ Python Specifics
👉 Filter Lists in Python 👉 Replacing List Items in Python 👉 Create a GUI in Python 👉 Find out the Length of a String in Python 👉 Enum in Python 👉 Python Inline If/Else One-Line Statements 👉 Python xrange() 👉 Python List Slicing 🏋️ Python Exercises
👉 Python Exercise Collection

whoami

Stefan founded Ceos3c in 2016 and has spent a decade teaching cybersecurity, Linux, and web development through hands-on tutorials. He builds and ships real products while sharing his journey: ProofSwap.me, XPMetric.com, and EasyEarningsTracker.com.

More about me