-1
我使用Anaconda3-4.2.0(Python 3.5.2)並嘗試在jupyter筆記本中導入numpy(1.13.1)。 當我只是嘗試。AttributeError:模塊'numpy.core.multiarray'沒有屬性'einsum'
import numpy as np
出現以下錯誤。 如何解決這個錯誤?
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-1-115b54337c44> in <module>()
1 import platform
2 print(platform.python_version())
----> 3 import numpy as np
/Users/user/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/__init__.py in <module>()
182 return loader(*packages, **options)
183
--> 184 from . import add_newdocs
185 __all__ = ['add_newdocs',
186 'ModuleDeprecationWarning',
/Users/user/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/add_newdocs.py in <module>()
11 from __future__ import division, absolute_import, print_function
12
---> 13 from numpy.lib import add_newdoc
14
15 ###############################################################################
/Users/user/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/lib/__init__.py in <module>()
6 from numpy.version import version as __version__
7
----> 8 from .type_check import *
9 from .index_tricks import *
10 from .function_base import *
/Users/user/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/lib/type_check.py in <module>()
9 'common_type']
10
---> 11 import numpy.core.numeric as _nx
12 from numpy.core.numeric import asarray, asanyarray, array, isnan, \
13 obj2sctype, zeros
/Users/user/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/core/__init__.py in <module>()
23 from . import numerictypes as nt
24 multiarray.set_typeDict(nt.sctypeDict)
---> 25 from . import numeric
26 from .numeric import *
27 from . import fromnumeric
/Users/user/.pyenv/versions/anaconda3-4.2.0/lib/python3.5/site-packages/numpy/core/numeric.py in <module>()
405 compare_chararrays = multiarray.compare_chararrays
406 putmask = multiarray.putmask
--> 407 einsum = multiarray.einsum
408 dot = multiarray.dot
409 inner = multiarray.inner
AttributeError: module 'numpy.core.multiarray' has no attribute 'einsum'
嘗試將您的conda和numpy版本更新到最新版本。 –
嘗試:'pip install --upgrade numpy' – RaminNietzsche