Search code examples
quantum-computingqiskit

Qiskit | ImportError: cannot import name 'Aer' from 'qiskit'


While installing and tried to import Aer, I get an error.

!pip install qiskit

import numpy as np
from qiskit import QuantumCircuit, Aer, transpile, assemble
from qiskit.visualization import plot_histogram
import random

Any inromation would be highly appreciated.

enter image description here


Solution

  • To fix this issue, install qiskit-aer package by doing pip install qiskit-aer. And then in your code replace:

    from qiskit import Aer to from qiskit_aer import Aer

    If you have any further problems please include your qiskit version in the question.