1

我正在使用安装了根python2.7( /usr/bin/python2.7) 的 linux 服务器。然后我尝试通过下载源代码并执行python2.7 setup.py build; python2.7 setup.py install --user. 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),在 numpy 中安装了一个工作/usr/lib/pymodules/python2.6/numpy

根据要求,堆栈跟踪,(并感谢您的说明!)。整个事情都在 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 ()
4

2 回答 2

1

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

首先要检查的是$PYTHONPATHand sys.path

于 2013-03-12T10:39:38.833 回答
0

我从来没有发现是什么原因造成的,但我让管理员以 root 身份安装了 numpy,它现在可以工作了。

于 2013-06-07T11:16:04.847 回答