【发布时间】:2020-09-16 12:08:17
【问题描述】:
我正在使用 Python 3 并且正在使用 jupyter,当我尝试导入 qiskit 时,显示以下错误:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-578b7f7e9727> in <module>
----> 1 import qiskit
~\AppData\Roaming\Python\Python36\site-packages\qiskit\quantum_info\synthesis\two_qubit_decompose.py in __init__(self, unitary_matrix)
169 # D, P = la.eig(M2) # this can fail for certain kinds of degeneracy
170 for i in range(100): # FIXME: this randomized algorithm is horrendous
--> 171 state = np.random.default_rng(i)
172 M2real = state.normal()*M2.real + state.normal()*M2.imag
173 _, P = la.eigh(M2real)
AttributeError: module 'numpy.random' has no attribute 'default_rng'
【问题讨论】:
-
什么 numpy 版本?
-
你能显示你的代码吗?它看起来不像
qiskit错误,而是numpy错误
标签: python numpy import attributes qiskit