Installation and Setup

System Requirements #

Before installing Qiskit, ensure your system meets these requirements:

  • Python: Version 3.8 or later (3.9+ recommended)
  • Operating System: Windows, macOS, or Linux
  • RAM: At least 4GB (8GB+ recommended for larger simulations)
  • Internet Connection: For accessing IBM Quantum services

Installing Python #

If you don’t have Python installed:

Windows #

Download from python.org and run the installer. Make sure to check “Add Python to PATH.”

macOS #

# Using Homebrew
brew install python3

Linux (Ubuntu/Debian) #

sudo apt update
sudo apt install python3 python3-pip

Installing Qiskit #

The simplest way to install Qiskit is using pip:

pip install qiskit

For the complete package with visualization tools:

pip install 'qiskit[visualization]'

To install additional modules:

pip install qiskit-aer  # High-performance simulators
pip install qiskit-ibm-runtime  # IBM Quantum access

Using Conda #

If you prefer Conda:

conda create -n qiskit-env python=3.9
conda activate qiskit-env
conda install -c conda-forge qiskit

Verifying Installation #

Test your installation by running:

import qiskit
print(qiskit.__version__)

# Create a simple quantum circuit
from qiskit import QuantumCircuit

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
print(qc)

If this runs without errors, your installation is successful!

Setting Up IBM Quantum Access #

To run circuits on real quantum hardware:

  1. Create an IBM Quantum Account

    • Visit quantum.ibm.com
    • Sign up for a free account
    • Navigate to your account settings to find your API token
  2. Save Your API Token

from qiskit_ibm_runtime import QiskitRuntimeService

# Save your credentials (one-time setup)
QiskitRuntimeService.save_account(
    channel="ibm_quantum",
    token="YOUR_API_TOKEN_HERE"
)
  1. Load Your Account
# In subsequent sessions
service = QiskitRuntimeService(channel="ibm_quantum")

Development Environment Options #

Install Jupyter:

pip install jupyter

Start Jupyter:

jupyter notebook

Visual Studio Code #

  1. Install VS Code from code.visualstudio.com
  2. Install the Python extension
  3. Install the Jupyter extension (optional but helpful)

Google Colab #

For cloud-based development without local installation:

!pip install qiskit

Installing Visualization Dependencies #

For circuit and result visualization:

pip install matplotlib
pip install pylatexenc  # For LaTeX-style circuit drawings

Troubleshooting #

Common Issues #

Import Error: No module named ‘qiskit’

# Make sure you're using the correct Python environment
which python
pip list | grep qiskit

Visualization Issues

# Install additional dependencies
pip install pillow
pip install pydot

Permission Errors on Linux/macOS

# Use --user flag
pip install --user qiskit

Updating Qiskit #

Keep Qiskit up to date:

pip install --upgrade qiskit

Next Steps #

Now that Qiskit is installed, you’re ready to:

  • Create your first quantum circuit
  • Run simulations
  • Explore quantum algorithms
  • Access real quantum hardware

Let’s dive into building quantum circuits in the next section!