0
import numpy as np
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import execute

When trying the above code, I am receiving the following error:

ModuleNotFoundError Traceback (most recent call last) in () 1 import numpy as np ----> 2 from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister 3 from qiskit import execute

ModuleNotFoundError: No module named 'qiskit'

Ishaan Javali
  • 1,711
  • 3
  • 13
  • 23
arilwan
  • 3,374
  • 5
  • 26
  • 62

3 Answers3

5

You need to install it via

pip install qiskit

Refer to this for more information https://github.com/Qiskit/qiskit/blob/master/docs/install.rst

xashru
  • 3,400
  • 2
  • 17
  • 30
  • `$pip install qiskit` Collecting qiskit Could not find a version that satisfies the requirement qiskit (from versions: ) No matching distribution found for qiskit – arilwan Feb 03 '19 at 14:57
  • 1
    ```$ pip3 install qiskit Requirement already satisfied: qiskit in /usr/local/lib/python3.7/site-packages (0.7.2) Requirement already satisfied: qiskit-terra<0.8,>=0.7 in /usr/local/lib/python3.7/site-packages (from qiskit) (0.7.0) Requirement already satisfied: qiskit-aer<0.2,>=0.1 in /usr/local/lib/python3.7/site-packag....``` – arilwan Feb 03 '19 at 15:00
  • also it could be installed but not activated so please make sure you run "conda activate ur_env_name" you may created with conda or whatever your vm. – Seif Mostafa May 03 '20 at 02:16
3

You need Python 3:

pip3 install qiskit

Refer to this for more information: https://github.com/Qiskit/qiskit-terra/issues/1751

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
Cristeam
  • 31
  • 1
0

You can either use the command;

pip install qiskit or

pip3 install qiskit (For Python 3.x+)

depending on the version of Python you're using.

buddemat
  • 4,552
  • 14
  • 29
  • 49