LinuxCommandLibrary

jupyter

Start Jupyter Notebook or JupyterLab servers

TLDR

Start a Jupyter notebook server in the current directory

$ jupyter notebook
copy

Open a specific Jupyter notebook
$ jupyter notebook [example.ipynb]
copy

Export a specific Jupyter notebook into another format
$ jupyter nbconvert --to [html|markdown|pdf|script] [example.ipynb]
copy

Start a server on a specific port
$ jupyter notebook --port [port]
copy

List currently running notebook servers
$ jupyter notebook list
copy

Stop the currently running server
$ jupyter notebook stop
copy

Start JupyterLab, if installed, in the current directory
$ jupyter lab
copy

SYNOPSIS

jupyter subcommand [options] [arguments]

Common subcommands include:
jupyter notebook: Launches the classic Jupyter Notebook interface.
jupyter lab: Launches the newer, more integrated JupyterLab interface.
jupyter console: Starts an interactive console for a kernel.
jupyter qtconsole: Starts an enhanced interactive console using Qt.
jupyter kernelspec: Manages Jupyter kernels.
jupyter serverextension: Manages Jupyter server extensions.
jupyter nbextension: Manages Jupyter notebook extensions (legacy).
jupyter troubleshoot: Gathers information for debugging.

PARAMETERS

--version
    Show the version number of the Jupyter application.

-h, --help
    Show a help message and exit. When used with a subcommand (e.g., jupyter notebook --help), it shows help for that specific subcommand.

DESCRIPTION

Jupyter is a widely used open-source project that supports interactive data science and scientific computing across all programming languages. The jupyter command serves as the primary entry point to the Jupyter ecosystem on a Linux system. It allows users to launch various Jupyter applications, most notably Jupyter Notebook and JupyterLab, which provide web-based interactive computing environments. These environments combine live code, equations, visualizations, and narrative text into a single document called a notebook.

Jupyter is language-agnostic, supporting over 100 programming languages through 'kernels.' A kernel is a program that runs and introspects the user's code. For instance, the IPython kernel allows Python code execution. The jupyter command simplifies the process of starting these environments, configuring server settings, managing kernels, and performing other administrative tasks related to the Jupyter installation. It is a fundamental tool for data scientists, researchers, and educators for rapid prototyping, data analysis, machine learning model development, and sharing reproducible research.

CAVEATS

Resource Consumption: Jupyter Notebook/Lab can consume significant system resources (CPU, RAM), especially with large datasets or complex computations. Running multiple instances or notebooks with heavy loads can impact system performance.
Security Implications: Running Jupyter on a public server without proper security measures (e.g., token-based authentication, SSL, firewall rules) can expose your system. Avoid running as root (--allow-root) in production environments due to inherent security risks.
Browser Dependency: Jupyter's interactive interface is web-based, requiring a modern web browser to function. Headless server environments might need configuration to prevent automatic browser launch.
Kernel Management: Installing and managing different language kernels (e.g., Python, R, Julia) requires careful environment management, often using tools like pip or conda, which can sometimes lead to dependency conflicts.

SUBCOMMANDS ARE KEY

The jupyter command itself acts as a dispatcher. Most functionality is exposed through its various subcommands, such as jupyter notebook, jupyter lab, jupyter kernelspec, etc. Each subcommand has its own specific set of options and arguments, which can be viewed using jupyter <subcommand> --help. For instance, jupyter notebook --port 8889 --no-browser launches a notebook server on port 8889 without opening a web browser automatically.

KERNELS

Jupyter's power comes from its 'kernels.' A kernel is a separate process responsible for running user code and communicating results back to the Jupyter frontend. While the default is the IPython kernel for Python, numerous other kernels exist for languages like R, Julia, Node.js, and many more, enabling a truly polyglot computing environment.

HISTORY

The Jupyter project originated from the IPython Notebook, initially released in 2011 as a web-based interface for interactive Python computing. It evolved significantly, and in 2014, the Project Jupyter (JUlia, PYThon, R) was born to encompass broader language support and extend the interactive computing paradigm beyond Python.

The core idea was to separate the user interface from the execution engine (the 'kernel'), allowing support for over 100 programming languages. The jupyter command line tool was introduced as the unified entry point for this expanded ecosystem. JupyterLab, a next-generation interactive development environment, was released in 2018, offering a more flexible and powerful workspace than the classic Notebook. The project has since become a cornerstone for data science, machine learning research, and education globally.

SEE ALSO

python(1): The primary programming language interpreter often used with Jupyter., pip(1): Python package installer, commonly used to install Jupyter and its dependencies., conda(1): Cross-platform package and environment manager, an alternative to pip for managing environments and packages, including Jupyter., tmux(1) / screen(1): Terminal multiplexers useful for running Jupyter server processes persistently in the background., htop(1) / top(1): System monitoring tools to observe resource usage of Jupyter processes., curl(1) / wget(1): Command-line tools for transferring data with URLs, useful for downloading data into Jupyter environments or accessing API endpoints.

Copied to clipboard