> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to open JupyterLab with Miniconda

export const TroubleshootSolution = ({children}) => <>
    <hr className="my-3 w-full" />
    <details className="mt-3">
      <summary className="cursor-pointer font-semibold text-base mb-1">
        Solution
      </summary>
      <div className="mt-2 ml-4" data-component-part="step-content">
        {children}
      </div>
    </details>
  </>;

export const TroubleshootCause = ({children}) => <details className="mt-3 mb-2">
    <summary className="cursor-pointer font-semibold text-base mb-1">
      Cause
    </summary>
    <div className="mt-2 ml-4" data-component-part="step-content">
      {children}
    </div>
  </details>;

export const TroubleshootTitle = ({children}) => <>
    <p className="m-0 font-semibold text-xl leading-tight mb-2" role="heading" aria-level={3}>
      {children}
    </p>
    <hr className="my-3 w-full" />
  </>;

export const Troubleshoot = ({children}) => <div className="callout my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border troubleshoot-admonition dark:troubleshoot-admonition" data-callout-type="troubleshoot">
    <div className="mt-0.5 w-4">
      <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" className="w-4 h-4" aria-label="Troubleshoot">
        <path d="M541.4 162.6C549 155 561.7 156.9 565.5 166.9C572.3 184.6 576 203.9 576 224C576 312.4 504.4 384 416 384C398.5 384 381.6 381.2 365.8 376L178.9 562.9C150.8 591 105.2 591 77.1 562.9C49 534.8 49 489.2 77.1 461.1L264 274.2C258.8 258.4 256 241.6 256 224C256 135.6 327.6 64 416 64C436.1 64 455.4 67.7 473.1 74.5C483.1 78.3 484.9 91 477.4 98.6L388.7 187.3C385.7 190.3 384 194.4 384 198.6L384 240C384 248.8 391.2 256 400 256L441.4 256C445.6 256 449.7 254.3 452.7 251.3L541.4 162.6z" />
      </svg>
    </div>
    <div className="prose min-w-0 w-full">{children}</div>
  </div>;

export const Comments = ({children}) => {
  return <div class="my-4 px-5 py-4 overflow-hidden rounded-2xl flex gap-3 border border-zinc-500/20 bg-zinc-50/50 dark:border-zinc-500/30 dark:bg-zinc-500/10" data-callout-type="comments">
      <div class="w-4">
        <svg width="14" height="14" viewBox="0 0 640 640" fill="currentColor" xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" aria-label="Comments">
            <path d="M320 112C434.9 112 528 205.1 528 320C528 434.9 434.9 528 320 528C205.1 528 112 434.9 112 320C112 205.1 205.1 112 320 112zM320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM280 400C266.7 400 256 410.7 256 424C256 437.3 266.7 448 280 448L360 448C373.3 448 384 437.3 384 424C384 410.7 373.3 400 360 400L352 400L352 312C352 298.7 341.3 288 328 288L280 288C266.7 288 256 298.7 256 312C256 325.3 266.7 336 280 336L304 336L304 400L280 400zM320 256C337.7 256 352 241.7 352 224C352 206.3 337.7 192 320 192C302.3 192 288 206.3 288 224C288 241.7 302.3 256 320 256z" />
        </svg>
      </div>
      <div class="text-sm prose min-w-0 w-full">
        {children}
      </div>
    </div>;
};

<Beginner>
  **Purpose**: This guide walks you through installing JupyterLab into a conda environment and opening it in your browser.

  **Audience**: Users who have Miniconda installed and are comfortable running conda commands in a terminal. If you're new to conda, start with the [Intro to conda workflows](/docs/getting-started/working-with-conda/conda-intro-tutorial) tutorial.
</Beginner>

<Note>
  Prefer a graphical interface? See [How to open JupyterLab with Anaconda Desktop](/docs/anaconda-desktop/tutorials/how-to-open-jupyterlab-desktop) or [How to open JupyterLab with Anaconda Navigator](/docs/legacy/anaconda-navigator/tutorials/how-to-open-jupyterlab).
</Note>

## Prerequisites

* Miniconda installed. See the Miniconda [installation guide](/docs/getting-started/installation) for your platform.
* Basic familiarity with conda commands and your system's terminal.

## Steps

<Steps>
  <Step title="Create and activate a conda environment">
    To avoid conflicts with other projects, create a dedicated environment rather than installing into `base`. Include `jupyterlab` in the environment creation command to install it along with Python.

    Open <Tooltip tip="A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.">Anaconda Prompt</Tooltip> (Terminal on macOS/Linux) and run:

    ```sh theme={null}
    conda create --name jupyter-env python jupyterlab
    conda activate jupyter-env
    ```

    Your command line updates to show the active environment name.
  </Step>

  <Step title="Launch JupyterLab">
    Start the JupyterLab server:

    ```sh theme={null}
    jupyter lab
    ```

    The terminal prints a startup log and JupyterLab opens automatically in a new tab in your default browser.

    <Accordion title="Browser didn't open?">
      Look for lines in your terminal output that look similar to the following:

      ```txt Example output theme={null}
        To access the server, open this file in a browser:
        file:/Users/username/Library/Jupyter/runtime/jpserver-54072-open.html
        Or copy and paste one of these URLs:
        http://localhost:8890/lab?token=...
        http://127.0.0.1:8890/lab?token=...

      ```

      Copy one of the URLs and paste it into your browser's address bar to open JupyterLab manually.
    </Accordion>
  </Step>

  <Step title="Open a notebook in your environment">
    In the Launcher, under **Notebook**, click the tile for your environment. It might appear as **Python 3 (ipykernel)** or **Python (your-environment-name)**.

    A new notebook opens with your environment's kernel active.
  </Step>

  <Step title="Stop the JupyterLab server">
    When you're done, return to the terminal where JupyterLab is running and press Ctrl+C.

    The server stops and the JupyterLab tab in your browser becomes unreachable.
  </Step>
</Steps>

## Troubleshooting

<Troubleshoot>
  <TroubleshootTitle>
    ### Kernel fails to start with "No such file or directory" error
  </TroubleshootTitle>

  <TroubleshootCause>
    A kernel spec is registered in JupyterLab that points to a conda environment that has been renamed, moved, or deleted. JupyterLab still shows the kernel in the selector, but can't find the Python executable at the recorded path.
  </TroubleshootCause>

  <TroubleshootSolution>
    1. List your registered kernels to find the stale entry:

       ```sh theme={null}
       jupyter kernelspec list
       ```

    2. Remove the stale kernel spec:

       ```sh theme={null}
       jupyter kernelspec remove <KERNEL_NAME>
       ```

           <Comments>
             Replace \<KERNEL\_NAME> with the name of the stale kernel from the list above.
           </Comments>

    3. Activate the environment you want to use and register it as a kernel:

       ```sh theme={null}
       conda activate <ENV_NAME>
       conda install ipykernel
       python -m ipykernel install --user --name <ENV_NAME> --display-name "Python (<ENV_NAME>)"
       ```

           <Comments>
             Replace \<ENV\_NAME> with the name of your conda environment.
           </Comments>

    4. Relaunch JupyterLab. The new kernel appears in the kernel selector.
  </TroubleshootSolution>
</Troubleshoot>

## Additional resources

* For help with JupyterLab's interface and features, see [JupyterLab's official documentation](https://jupyterlab.readthedocs.io/en/latest/user/index.html).
* To create, update, or remove conda environments, see [Managing conda environments](/docs/getting-started/working-with-conda/environments).
* To add packages to your environment, see [Installing conda packages](/docs/getting-started/working-with-conda/packages/install-packages).
* To use Jupyter Notebooks with Package Security Manager (On-prem), see [Jupyter Notebooks](/docs/psm-on-prem/6.8.0/user/notebook).
* To use Jupyter Notebooks in the browser without a local installation, see [Anaconda Notebooks](/docs/anaconda-platform/notebooks/key-features) in the Package Security Manager (Cloud) documentation.

## Feedback

Use the <Icon icon="thumbs-up" iconType="light" aria-label="thumbs up" /> **Yes** or <Icon icon="thumbs-down" iconType="light" aria-label="thumbs down" /> **No** feedback buttons below to let us know what worked and what didn't. Sharing details about your experience helps us know what to improve.
