# How to open Jupyter from the terminal (Windows and macOS)

> Start JupyterLab or Jupyter Notebook from Windows and macOS terminals

Canonical HTML: https://www.runcell.dev/docs/faq/how-to-open-jupyter-from-terminal

## 1. TL;DR

Already have Jupyter installed? Run one of these in your terminal:

```bash
# JupyterLab (recommended)
jupyter lab

# Classic Notebook (optional)
jupyter notebook
```

If the command isn’t found, try:

```bash
python -m jupyterlab
# or
python -m notebook
```

> Need to install Jupyter first? See the [installation guide](https://www.runcell.dev/docs/faq/how-to-install-jupyter.md).

***

## 2. Prerequisites

* **Jupyter installed** in the environment you plan to use
* A terminal: **PowerShell/Command Prompt/Anaconda Prompt** (Windows) or **Terminal** (macOS)
* Optional but recommended: a **virtual environment** (`venv`, `conda`, or `uv`)

***

## 3. Windows

### 3.1 Choose the right terminal

* **If you used Anaconda/Miniconda**: open **Anaconda Prompt** (or PowerShell) and `conda activate your-env`
* **If you used pip/venv**: open **PowerShell** or **Command Prompt** and activate your venv

```powershell
# In your project directory
python -m venv .venv
.\.venv\Scripts\activate
pip install jupyterlab
jupyter lab
```

### 3.2 Launch

```powershell
jupyter lab          # recommended UI
# or
jupyter notebook     # classic UI
```

If `jupyter` isn’t recognized:

```powershell
python -m jupyterlab
# or, use the full path inside the venv
.\.venv\Scripts\jupyter-lab.exe
```

When prompted by Windows Firewall, click **Allow access**. Your browser will open at `http://localhost:8888/lab` (or it will print a URL with a token—copy/paste it into the browser).

### 3.3 Open a specific folder or notebook

```powershell
jupyter lab path\to\your\project
jupyter lab path\to\notebook.ipynb
```

### 3.4 Common checks

```powershell
where jupyter          # which executable will run
jupyter lab --version  # verify Lab is installed
jupyter --paths        # see config/data dirs
```

***

## 4. macOS

Open the **Terminal** app. If you’re using a virtual environment, activate it first.

```bash
cd /path/to/project
python -m venv .venv
source .venv/bin/activate
pip install jupyterlab
jupyter lab
```

If `jupyter` isn’t found:

```bash
python -m jupyterlab
# or
~/.venv/bin/jupyter-lab  # adjust path if using a different venv location
```

Your default browser will open at `http://localhost:8888/lab`. If it doesn’t, copy the URL (with token) printed in the terminal and open it, or run:

```bash
open http://localhost:8888/lab
```

Open a specific folder or notebook:

```bash
jupyter lab /path/to/project
jupyter lab /path/to/notebook.ipynb
```

Quick checks:

```bash
which jupyter
jupyter lab --version
jupyter --paths
```

***

## 5. Useful options (both Windows and macOS)

* Start on a different port:

```bash
jupyter lab --port 9000
```

* Don’t open a browser (useful on a remote or headless machine):

```bash
jupyter lab --no-browser
```

* Run in the background and log to a file:

```bash
# macOS / Linux
jupyter lab --no-browser > lab.log 2>&1 &

# Windows (PowerShell)
Start-Process jupyter -ArgumentList 'lab --no-browser' -NoNewWindow
```

* Open a specific working directory:

```bash
jupyter lab /path/to/your/workspace
```

***

## 6. Troubleshooting

* **“jupyter: command not found” or “not recognized”**
  * Activate the right environment first
  * Try `python -m jupyterlab`
  * Reinstall in the active env: `pip install -U jupyterlab`

* **Browser doesn’t open automatically**
  * Copy the `http://localhost:8888/...` URL with the token from the terminal
  * Or open manually: macOS `open http://localhost:8888/lab`, Windows `start http://localhost:8888/lab`

* **Wrong environment (extensions/packages missing)**
  * Check paths: `which jupyter` (macOS) or `where jupyter` (Windows)
  * Ensure `python`, `pip`, and `jupyter` point to the same env

* **Want a password instead of a token?**
  * Set one once: `jupyter server password`

* **Port already in use**
  * Pick another: `jupyter lab --port 9001`

If you still can’t launch Jupyter, revisit the [installation guide](https://www.runcell.dev/docs/faq/how-to-install-jupyter.md) to confirm your environment is set up correctly.
