Jupyter Notebook is an open-source web application that allows you to create and share documents containing live code, equations, visualizations, and narrative text. It is widely used in data science and machine learning projects. This article will guide you through the process of installing and running Jupyter Notebook on a Windows operating system.
Step 1: Install Python
Jupyter Notebook requires Python to be installed on your system. Follow these steps to install Python:
- Download the latest version of Python from the official Python website.
- Run the installer and ensure you check the box that says "Add Python to PATH" before clicking "Install Now".
- Verify the installation by opening Command Prompt (CMD) and typing:
python --version
Step 2: Install Jupyter Notebook
Once Python is installed, you can install Jupyter Notebook using pip, which is the package installer for Python.
- Open Command Prompt (CMD).
- Install Jupyter Notebook by running the following command:
pip install notebook
Step 3: Launch Jupyter Notebook
After installation, you can launch Jupyter Notebook from the Command Prompt.
- Open Command Prompt (CMD).
- Navigate to the directory where you want to save your notebooks using the
cd
command. For example:
cd C:\Users\YourUsername\Documents
- Start Jupyter Notebook by typing:
jupyter notebook
- This command will open a new tab in your default web browser with the Jupyter Notebook interface.
Step 4: Create and Run a Jupyter Notebook
- In the Jupyter Notebook interface, click on "New" and select "Python 3" to create a new notebook.
- You can now write and execute Python code in the notebook cells. For example, enter the following code in a cell:
print("Hello, Jupyter!")
- To execute the code, press
Shift + Enter
or click the "Run" button.
Step 5: Save and Close Jupyter Notebook
- To save your notebook, click on "File" and then "Save and Checkpoint".
- To close Jupyter Notebook, go back to the Command Prompt where you launched it and press
Ctrl + C
. Confirm the shutdown by typing y
and pressing Enter
.
Additional Tips
- You can install additional Python packages using pip to extend the functionality of your notebooks.
- Jupyter Notebook supports multiple languages, but you need to install the appropriate kernels for languages other than Python.