Install Notebook in a project environment
Instructions checked 18 October 2026 against the official documentation linked below. Menu labels may differ between releases; verify the selected interpreter rather than relying only on its display name.
Jupyter Notebook is a browser interface backed by a local server and a kernel. The Python kernel runs your code. This guide uses the current Notebook 7-style workflow and a separately installed Python; it does not require a hosted notebook service.
Create and activate a project .venv first. Run the commands below in that activated terminal. Keep the terminal open while using Notebook. Installing Notebook downloads its dependencies.
Activated environment — terminal
python -m pip install notebook
python -m notebookCreate a notebook and run a cell
- Open the local URL printed by the server if a browser window does not open automatically. Keep any access token private.
- Create a new notebook and choose its Python kernel. Name it hello.ipynb.
- In a code cell, enter print("Hello, Python!"). Run with Shift+Enter or the cell’s Run control. Read the output below the cell.
- Add a Markdown cell for a note describing what you expected. Save the notebook. It stores cells and outputs; it is not the same file format as hello.py.
Confirm the kernel and rerun cleanly
A kernel retains variables between cell executions. Running cell 3 before cell 1 can fail, or appear to work only because an old value remains in memory. Restart the kernel and run all cells from top to bottom before considering the notebook reproducible.
Run the diagnostic below in a code cell. For a separate environment that is not listed, activate that environment in a terminal, install ipykernel and register a clearly named kernel, then select it in Notebook.
Python — notebook code cell
import sys
print(sys.version)
print(sys.executable)Optional: activated separate environment — terminal
python -m pip install ipykernel
python -m ipykernel install --user --name python-practice --display-name "Python (python-practice)"Common problems
No module named notebook means the launching interpreter lacks Notebook. A missing package inside a cell concerns the kernel’s interpreter, which can differ from the server’s interpreter. Compare sys.executable instead of repeatedly reinstalling globally.
If a cell stays busy, inspect for a long-running loop or a request for input, then interrupt the kernel if necessary. Restarting clears its memory. Save any work first.
When finished, save, shut down the kernel/server through its controls or Ctrl+C in the server terminal and follow the prompt. Closing the browser tab alone does not necessarily stop them. Keep the server local; do not publish tokens or run untrusted notebooks.
Syntax
print("Hello, Python!")Examples
Your first Python program
Save as hello.py in your project folder. Expected output: Hello, Python!
print("Hello, Python!")- print is a built-in function that writes to the output stream.
- The quoted text is a string. The quotes are not printed.
- Parentheses pass that string to print. No extra package is required.
Best practices
- Save your work before running it, and check the output after each small change.
- Keep your learning project in its own folder. Do not name files after standard modules such as random.py or json.py.
Runtime & versions
Python interpreter. Feature availability depends on the language and runtime version used by your project; consult the official reference below.
Python language reference