---
title: Installation instructions
description: Installation instructions for the latest version of Sample-based quantum diagonalization (SQD)
source: https://eu-de.quantum.cloud.ibm.com/docs/en/addons/qiskit-addon-sqd/install
---

# Installation instructions

To install, first create a new Python environment:

## Prerequisites

Create a minimal environment with only Python installed in it. We recommend using [Python virtual environments](https://docs.python.org/3/tutorial/venv.html).

```sh
python3 -m venv /path/to/virtual/environment
```

Activate your new environment.

```sh
source /path/to/virtual/environment/bin/activate
```

There are two primary ways to install this package – from PyPI or source. The preferred method is to install from PyPI:

## Install from PyPI

```sh
pip install 'qiskit-addon-sqd'
```

## Install from source

Install from source if you wish to develop in the repository or run the notebooks locally.

The first step is to clone the `qiskit-addon-sqd` repository.

```sh
git clone git@github.com:Qiskit/qiskit-addon-sqd.git
```

Next, upgrade pip and enter the repository.

```sh
pip install --upgrade pip
cd qiskit-addon-sqd
```

The next step is to install `qiskit-addon-sqd` to the virtual environment. If you plan on running the notebooks, install the notebook dependencies in order to run all the visualizations in the notebooks. Install the `dev` dependencies if you plan on developing in the repository.

Adjust the options below to suit your needs.

```sh
pip install tox notebook -e '.[notebook-dependencies,dev]'
```

If you installed the notebook dependencies, you can get started by running the notebooks in the docs.

```python
cd docs/
jupyter lab
```
