ipython notebook 不能导入numpy
我在server上安装了ipython notebook。启动后import numpy报如下异常:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-5a0bd626bb1d> in <module>()
----> 1 import numpy
/home/users/kuangzhexi/.jumbo/lib/python2.7/site-packages/numpy/__init__.py in <module>()
151 return loader(*packages, **options)
152
--> 153 from . import add_newdocs
154 __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
155
/home/users/kuangzhexi/.jumbo/lib/python2.7/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 ###############################################################################
/home/users/kuangzhexi/.jumbo/lib/python2.7/site-packages/numpy/lib/__init__.py in <module>()
15 from .ufunclike import *
16
---> 17 from . import scimath as emath
18 from .polynomial import *
19 #import convertcode
ImportError: cannot import name scimath
我看了stackoverflow如下两个答案:
http://stackoverflow.com/questions/26238004/ipython-notebook-throws-importerror-ipython-doesnt
http://stackoverflow.com/questions/15514593/importerror-no-module-named-when-trying-to-run-python-script/15622021#15622021
我的操作是:
sys.path.append('/home/users/kuangzhexi/.jumbo/lib/python2.7/site-packages/numpy/lib')
sys.path.append('/home/users/kuangzhexi/.jumbo/lib/python2.7/site-packages/numpy/')
但是还是不行。
WingHCC
10 years, 11 months ago