1

While trying to run the following commands on Jupyter

from qiskit import QuantumCircuit, Aer, BasicAer, execute
from qiskit.visualization import plot_histogram

I am encountering the following error.I am using python 3.8. Does anyone have any idea how can this be resolved? I have tried upgrading numpy and reinstalling Qiskit but the problem prevails

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-3-a0c116756cb0> in <module>
----> 1 from qiskit import QuantumCircuit, Aer, BasicAer, execute
      2 from qiskit.visualization import plot_histogram

C:\ProgramData\Anaconda3\lib\site-packages\qiskit\__init__.py in <module>
     55 # Try to import the Aer provider if installed.
     56 try:
---> 57     from qiskit.providers.aer import Aer
     58 except ImportError:
     59     suppress_warnings = os.environ.get('QISKIT_SUPPRESS_PACKAGING_WARNINGS', '')

C:\ProgramData\Anaconda3\lib\site-packages\qiskit\providers\aer\__init__.py in <module>
     62 
     63 # pylint: disable=wrong-import-position
---> 64 from .aerprovider import AerProvider
     65 from .aerjob import AerJob
     66 from .aererror import AerError

...

C:\ProgramData\Anaconda3\lib\site-packages\qiskit\providers\aer\pulse\qutip_extra_lite\fastsparse.py in <module>
    438 # -------------------------------------
    439 # pylint: disable=no-name-in-module, wrong-import-position, import-error
--> 440 from .cy.spmath import (zcsr_transpose, zcsr_adjoint, zcsr_mult)

spmath.pyx in init qiskit.providers.aer.pulse.qutip_extra_lite.cy.spmath()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
Osama Younus
  • 115
  • 1
  • 8
  • Does this answer your question? [QISKIT error - numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject](https://stackoverflow.com/questions/66193302/qiskit-error-numpy-ndarray-size-changed-may-indicate-binary-incompatibility) – luciano Feb 14 '21 at 20:32
  • yes it did @luciano I dont get why the issue happened though – Osama Younus Feb 14 '21 at 20:37

1 Answers1

0

worked after I used the following command

pip install --ignore-installed qiskit-terra qiskit-aer
Osama Younus
  • 115
  • 1
  • 8