Python

Install Jupyter and open a notebook

Install JupyterLab in your project's virtual environment, start it and open a notebook in your browser.

  1. Go to your project folder
    Terminal
    cd my-project

    Use your own folder name.

  2. Create a virtual environment
    Terminal
    python3 -m venv .venv

    Skip this if your project already has one.

  3. Switch it on
    Terminal
    source .venv/bin/activate

    Your prompt now starts with (.venv).

  4. Install JupyterLab
    Terminal
    pip install jupyterlab
  5. Start JupyterLab
    Terminal
    jupyter lab

    Your browser opens JupyterLab. If it doesn't, copy the link that starts with http://localhost:8888 from the terminal. To open a new notebook, choose File > New > Notebook and pick the Python 3 kernel. Notebooks save as .ipynb files in your project folder. Press Ctrl + C in the terminal to stop the server when you're done.

  6. Prefer the classic notebook view? (optional)
    Terminal
    pip install notebook && jupyter notebook

    This opens the older, simpler Jupyter Notebook screen instead of JupyterLab. Press Ctrl + C to stop it.

Check it worked

  1. Check Jupyter is installed in the environment
    Terminal
    jupyter --version
Undo it
  1. Remove Jupyter
    Terminal
    pip uninstall -y jupyterlab notebook

    Your notebook files stay in your folder.

  2. Switch the environment off
    Terminal
    deactivate
  1. Go to your project folder
    Terminal · Ubuntu / Debian
    cd my-project

    Use your own folder name.

  2. Create a virtual environment
    Terminal · Ubuntu / Debian
    python3 -m venv .venv

    Skip this if your project already has one. On Debian and Ubuntu you may need sudo apt install python3-venv first.

  3. Switch it on
    Terminal · Ubuntu / Debian
    source .venv/bin/activate

    Your prompt now starts with (.venv).

  4. Install JupyterLab
    Terminal · Ubuntu / Debian
    pip install jupyterlab
  5. Start JupyterLab
    Terminal · Ubuntu / Debian
    jupyter lab

    Your browser opens JupyterLab. If it doesn't, copy the link that starts with http://localhost:8888 from the terminal. To open a new notebook, choose File > New > Notebook and pick the Python 3 kernel. Notebooks save as .ipynb files in your project folder. Press Ctrl + C in the terminal to stop the server when you're done.

  6. Prefer the classic notebook view? (optional)
    Terminal · Ubuntu / Debian
    pip install notebook && jupyter notebook

    This opens the older, simpler Jupyter Notebook screen instead of JupyterLab. Press Ctrl + C to stop it.

Check it worked

  1. Check Jupyter is installed in the environment
    Terminal · Ubuntu / Debian
    jupyter --version
Undo it
  1. Remove Jupyter
    Terminal · Ubuntu / Debian
    pip uninstall -y jupyterlab notebook

    Your notebook files stay in your folder.

  2. Switch the environment off
    Terminal · Ubuntu / Debian
    deactivate
  1. Go to your project folder
    PowerShell
    cd my-project

    Use your own folder name.

  2. Create a virtual environment
    PowerShell
    py -m venv .venv

    Skip this if your project already has one.

  3. Switch it on
    PowerShell
    .venv\Scripts\Activate.ps1

    Your prompt now starts with (.venv). If PowerShell says scripts are disabled, see the virtual environment page.

  4. Install JupyterLab
    PowerShell
    pip install jupyterlab
  5. Start JupyterLab
    PowerShell
    jupyter lab

    Your browser opens JupyterLab. If it doesn't, copy the link that starts with http://localhost:8888 from the terminal. To open a new notebook, choose File > New > Notebook and pick the Python 3 kernel. Notebooks save as .ipynb files in your project folder. Press Ctrl + C in the terminal to stop the server when you're done.

  6. Prefer the classic notebook view? Install it (optional)
    PowerShell
    pip install notebook
  7. Start the classic notebook view (optional)
    PowerShell
    jupyter notebook

    This opens the older, simpler Jupyter Notebook screen instead of JupyterLab. Press Ctrl + C to stop it.

Check it worked

  1. Check Jupyter is installed in the environment
    PowerShell
    jupyter --version
Undo it
  1. Remove Jupyter
    PowerShell
    pip uninstall -y jupyterlab notebook

    Your notebook files stay in your folder.

  2. Switch the environment off
    PowerShell
    deactivate