Numpy Import“Aborted”

时间:2013-03-12 09:27:23

标签: python numpy installation

我正在安装根目录python2.7/usr/bin/python2.7)的Linux服务器上。然后我尝试通过下载源并执行python2.7 setup.py build; python2.7 setup.py install --user将Numpy安装到此。 Numpy整齐地安装到~/.local/lib/python2.7/site-packages/numpy。我明白了:

$ python2.7
Python 2.7.2+ (default, Dec 22 2011, 12:26:43)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Aborted
$

我从哪里开始?我以前从未见过这个!

(仅供参考,默认的python(2.6),在/usr/lib/pymodules/python2.6/numpy中安装了numpy

根据要求, stacktrace ,(并感谢有关的说明!)。整件事here on pastebin

Program received signal SIGABRT, Aborted.
0x00002aaaabdb31b5 in *__GI_raise (sig=<value optimized out>)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
64  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
    in ../nptl/sysdeps/unix/sysv/linux/raise.c
(gdb) bt
#0  0x00002aaaabdb31b5 in *__GI_raise (sig=<value optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1  0x00002aaaabdb5fc0 in *__GI_abort () at abort.c:92
#2  0x00002aaab03fb9bd in free () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#3  0x00002aaab03f8312 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#4  0x00002aaab03f8924 in ffi_closure_alloc () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#5  0x00002aaab03f0af2 in _ctypes_alloc_callback () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#6  0x00002aaab03eee68 in ?? () from /usr/lib/python2.7/lib-dynload/_ctypes.so
#7  0x00000000004b6ed5 in ?? ()
#8  0x0000000000425cdc in PyObject_Call ()

2 个答案:

答案 0 :(得分:1)

这看起来像版本问题。确保您不会无意中将为Python 2.6构建的模块加载到Python 2.7中。

首先要检查的是$PYTHONPATHsys.path

答案 1 :(得分:0)

我从来没有发现导致这种情况的原因,但我将管理员安装为根目录并且现在可以正常工作。