How to install JupyterLab and Jupyter Notebook

Installing Jupyterlab

For years, Jupyter Notebook, with its simple-to-use, streamlined, and document-centric interface has been the go-to web application for creating and sharing scientific computational documents. It supports a wide range of programming languages, and it allows users to produce rich and interactive outputs in a range of formats.

In turn, JupyterLab is the next generation of Jupyter Notebook, and it expands the Notebook’s capabilities and solves many of its usability challenges. Apart from building on the features of Jupyter Notebook, it features a modular structure that facilitates expanding and enriching its functionality using extensions.

Simply put, JupyterLab and Jupyter Notebook are vital tools if you do anything related to scientific computing. Now, in this post, we’ll look at how you can install these two applications on your PC.

Installing Jupyter Notebook

Let’s start by looking at how you would install Jupyter Notebook on your PC. Here, there are two ways in which you can install Jupyter Notebook, depending on your experience.

Using Anaconda and Conda

Installing Jupyter Notebook by using Anaconda is the recommended way for new, inexperienced users. This is simply because Anaconda conveniently installs Python, Jupyter Notebook, and other commonly used packages used for data science and scientific computing at the time of installation.

Sign Up for Email Updates

To use this method, you’ll need to follow the following steps:

The first step is to download Anaconda for your specific operating system from the official Anaconda website. When you do, it’s recommended that you download the latest Python 3 version.

Once you’ve downloaded Anaconda, you can follow the instructions on the download page to install the application on your PC.

When the Anaconda installation is complete, you have installed Jupyter Notebook.

If it so happens that you’ve installed Anaconda without Jupyter Notebook, you can open the Anaconda Navigator and click on the Install Jupyter Notebook button. Either way, once Jupyter Notebook has been installed, you can run the notebook by using the following command in your terminal or command prompt:

`jupyter notebook`

Using pip

Apart from using Anaconda to install Jupyter Notebook, you can also use pip. This method is suitable for more advanced users or those who already use Python. In this case, however, Python needs to be installed first.

As such, if Python is not installed on your machine already, you would need to do that first. For that, you can follow the instructions in the documentation on the official Python website. Remember, however, that when you install Python, you install version 3.3 or later or version 2.7. IPython 1.x. Once you have Python installed, you can move on to install Jupyter Notebook.

For this method, you first need to ensure that you have the latest version of pip installed. If not, you might have some trouble with some dependencies. To make sure you have the latest version, you can update pip using the following command:

`pip3 install –upgrade pip`

Once you’ve updated pip, you can install Jupyter Notebook using the following command:

`pip3 install jupyter`

When you’ve installed Jupyter Notebook, you can, as mentioned earlier, run the notebook using:

`jupyter notebook`

It’s important to note that, if you’re using Python 2.7, you’ll use pip instead of pip3 when running the mentioned commands in the terminal or command prompt.

Installing Jupyter Lab

Now that we’ve seen how you would install Jupyter Notebook, let’s look at how you can install JupyterLab. Here, like Jupyter Notebook, you have several options. As such, you can use conda, mamba, pip, pipenv, or docker.

Using conda

To use conda, you first need to install Anaconda. For this, you can use the steps mentioned earlier. Once you’ve installed Anaconda, you can install JupyterLab using this command:

`conda install -c conda-forge jupyterlab`

Using mamba

You can also install JupyterLab using mamba. Mamba is a Python-based command-line interface that serves as a replacement for conda and promises more speed and reliability. As a result, to use this method, you would need to install Mamba first. You can do this by downloading and installing mambaforge for Windows, macOS, or Linux, or by using the following command on an existing Anaconda installation:

`conda install mamba -n base -c conda-forge`

Once you’ve installed mamba, you can install JupyterLab using:

`mamba install -c conda-forge jupyterlab`

Using pip

You can also install JupyterLab by using pip. As mentioned earlier, this method requires that you have Python installed. If it is, you can install JupyterLab with the following command:

`pip install jupyterlab`

Once again, as we’ve already mentioned, when you have Python version 2.7, you need to use the pip command instead of pip3.

Using pipenv

Pipenv is a tool that makes it so much simpler to set up virtual environments, and it eliminates the need for using pip and virtualenv separately. However, the tool does not come with a standard installation of Python. Thus, to install JupyterLab using pipenv, you first need to install it using:

`pip install –user pipenv`

With this command, user is your username on the machine you’re installing it on. Once you’ve installed pipenv, you can install JupyterLab with the following commands:

`pipenv install jupyterlab
pipenv shell`

When you’ve installed JupyterLab using pipenv, you’ll first need to enter the virtual environment before you can run the application. As such, you’ll need to run the following commands:

`pipenv shell
jupyter lab`

Using Docker

If you have Docker installed, you can also use it to install JupyterLab. To do this, you’ll use one of the many ready-to-run Docker images maintained by the Jupyter team. To deploy these Docker images, you’ll need to follow the instructions in the Quick Start Guide.

In Closing

Hopefully, this post helped illustrate how you would go about installing JupyterLab and Jupyter Notebook on your PC. If you want to know more about how to use these tools or learn more about data science and cloud computing, get in touch with us.

Pierian Training is trusted by over 2.8 million students and offers instructor-led training, taught by technical experts, in data science and cloud computing.

Sign Up for Email Updates
Pierian Training
Pierian Training

You May Also Like

Data Science, Tutorials

Analyzing Senate Stock Trades

Analyzing Stock Market Activity of US Senators with Python¶ In 2012, a law called ” Stop Trading on Congressional Knowledge (STOCK) Act of 2012″ was passed, which prohibits the use of non-public information for private profit, including insider trading by members of Congress and other government employees. This law however did not completely ban stock, […]

Data Science

How to Become a Data Scientist

Organizations globally are increasingly relying on data to make their business processes more efficient, reach their customers more effectively, and make better decisions. Being a data scientist can be an extremely rewarding career, where you help these organizations gain insights from their data and make the decisions that really matter. But people often want to […]

Data Science

Top 10 Pandas Methods You Haven’t Heard of

If you’re a data scientist, you’ve probably heard of Pandas. It’s one of the most popular open-source data analysis libraries out there. But did you know that Pandas has a ton of hidden features? In this blog post, we’ll discuss 10 Pandas methods that you haven’t heard of. These methods can help you do everything […]