Open In App

How to run an .ipynb Jupyter Notebook from terminal?

Last Updated : 25 Sep, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Let’s see how to run Notebook in Jupyter from a terminal in this article, but first, let’s get a sense of what these terms mean.

  • Python: Python is a versatile and high-level programming language known for its readability and extensive libraries, making it a popular choice for web development, data analysis, artificial intelligence, and more.
  • Jupyter Notebook: Jupyter Notebook is an interactive web-based tool that allows you to create and share documents containing live code, visualizations, and narrative text, making it ideal for data exploration, scientific research, and educational purposes.
  • CMD: Command Prompt is a text-based interface in the Windows operating system that enables users to interact with the computer by executing commands, running scripts, and managing system tasks through a command-line interface.

Prerequisites

Please ensure that Python and PIP are installed on your machine before continuing. If required visit Installation of Python or Installation of PIP on Windows.

Make sure all the required dependencies are installed and are on the latest version. First, run cmd as an Administrator and execute.

pip install jupyter

0-(1)

111-(1)

Creating a New Python Notebook File

Now, we will create a new Python notebook file. For this demo, we will crate a very basic notebook file with just one cell in it. Start the Jupyter Notebook by executing:

jupyter notebook

aaaaaaaa1-(1)

5

Screenshot-2023-09-10-103313

Running the .ipynb file from the terminal

We can run this notebook file direclty from terminal in two ways:

  • Using the nbconvert command to convert the python notebook to a python file.

ss-(1)

  • Using the notebook command to execute the notebook with a Jupyter instance.
jupyter notebook <notebook>.ipynb

za1-(1)

a2-(1)


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads