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.
Don’t wait, download now and transform your career!Your FREE Guide to Become a Data Scientist
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.
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
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
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.