安装了anaconda3,自带numpy库,但不能导入,问题出在哪里?
是我在jupter notebook网页上输入import numpy后,显示ImportError,但我已经安装了numpy库。
以下是错误的信息:
ImportError Traceback (most recent call last)
~\AppData\Roaming\Python\Python36\site-packages\numpy\core__init__.py in ()
15 try:
---> 16 from . import multiarray
17 except ImportError as exc:
ImportError: cannot import name 'multiarray'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
in ()
----> 1 import numpy
~\AppData\Roaming\Python\Python36\site-packages\numpy__init__.py in ()
140 return loader(*packages, **options)
141
--> 142 from . import add_newdocs
143 all = ['add_newdocs',
144 'ModuleDeprecationWarning',
~\AppData\Roaming\Python\Python36\site-packages\numpy\add_newdocs.py in ()
11 from future import division, absolute_import, print_function
12
---> 13 from numpy.lib import add_newdoc
14
15 ###############################################################################
~\AppData\Roaming\Python\Python36\site-packages\numpy\lib__init__.py in ()
6 from numpy.version import version as version
7
----> 8 from .type_check import *
9 from .index_tricks import *
10 from .function_base import *
~\AppData\Roaming\Python\Python36\site-packages\numpy\lib\type_check.py in ()
9 'common_type']
10
---> 11 import numpy.core.numeric as _nx
12 from numpy.core.numeric import asarray, asanyarray, array, isnan, zeros
13 from .ufunclike import isneginf, isposinf
~\AppData\Roaming\Python\Python36\site-packages\numpy\core__init__.py in ()
24 Original error was: %s
25 """ % (exc,)
---> 26 raise ImportError(msg)
27
28 for envkey in env_added:
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: cannot import name 'multiarray'
问题补充:1.我已经在网上搜索了的问题,有人说需要卸载numpy库后重新装,试了但不管用,同时,我又重装了anaconda,也不管用。
2.我的电脑上还同时安装了独立的python3,python2。python3是默认系统。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
看情况是你安装的numpy有问题,是没法导入multiarray这个包
如果你是windows系统应该看看环境变量是不是设置到了anaconda的目录下
如果你是linux系统应该看看是不是设置了软链到anaconda的python
问题解决了吗?