1

尝试在 Jupyter 上运行以下命令时

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

我遇到以下错误。我使用的是 python 3.8。有谁知道如何解决这个问题?我已经尝试升级 numpy 并重新安装 Qiskit 但问题仍然存在

---------------------------------------------------------------------------
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
4

1 回答 1

0

在我使用以下命令后工作

pip install --ignore-installed qiskit-terra qiskit-aer
于 2021-02-14T20:28:35.313 回答