pip install scipy,失败,错误代码为-11

时间:2014-10-08 03:02:25

标签: python scipy virtualenv

我在virtualenv中为theano安装了scipy,它在安装开始后就失败了。并说它失败了,错误代码为-11。任何人都可以帮我这个,错误代码11是什么?

以下是从运行命令开始时的错误的完整跟踪:

(dl)[haohan@sirius deeplearning]$ pip install theano
Requirement already satisfied (use --upgrade to upgrade): theano in ./dl/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.5.0 in ./dl/lib/python2.7/site-   packages (from theano)
Downloading/unpacking scipy>=0.7.2 (from theano)
Downloading scipy-0.14.0.tar.gz (10.2MB): 10.2MB downloaded
Running setup.py (path:/home/haohan/deeplearning/dl/build/scipy/setup.py) egg_info for package scipy

    warning: no previously-included files matching '*_subr_*.f' found under directory 'scipy/linalg/src/id_dist/src'
    no previously-included directories found matching 'scipy/special/tests/data/boost'
    no previously-included directories found matching 'scipy/special/tests/data/gsl'
    no previously-included directories found matching 'doc/build'
    no previously-included directories found matching 'doc/source/generated'
    no previously-included directories found matching '*/__pycache__'
    warning: no previously-included files matching '*~' found anywhere in distribution
    warning: no previously-included files matching '*.bak' found anywhere in distribution
    warning: no previously-included files matching '*.swp' found anywhere in distribution
    warning: no previously-included files matching '*.pyo' found anywhere in distribution
Installing collected packages: scipy
    Running setup.py install for scipy
Cleaning up...
Command /home/haohan/deeplearning/dl/bin/python -c "import setuptools, tokenize;__file__='/home/haohan/deeplearning/dl/build/scipy/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --record /tmp/pip-svx8Wr-record/install-record.txt --single-version-externally-managed --compile --install-headers 
/home/haohan/deeplearning/dl/include/site/python2.7 failed with error code -11 in /home/haohan/deeplearning/dl/build/scipy
Storing debug log for failure in /home/haohan/.pip/pip.log

为了方便阅读,我将第二行打破成几行 我认为这很奇怪,安装开始后几乎没有发生错误,我只是使用pip成功安装numpy,所以它不太可能是pip的问题。那么,问题出在哪里?我该如何解决?

它可能与系统有关吗?但我想我无法打印出系统信息,因为我没有sudo权限......

可能因为我们的群集太旧了吗?这是我能想到的唯一解释。

非常感谢!

1 个答案:

答案 0 :(得分:0)

您是否尝试过更新setuptools?

pip install --upgrade setuptools

然后再次尝试安装theano。

当我在开发自己的包时遇到此问题时,根本原因是setup.py中的导入。我改变了setup.py导入的内容,然后才起作用。也许theano的设置是导入包含不兼容版本的软件包?

如果通过更新软件包或编辑设置中的导入来解决问题,您可以尝试使用vvv标志进行调试以获取更多信息,如pip install -vvv theano中所示。

至于你看到的错误代码:

  

负值-N表示孩子被信号终止   N(仅限Unix)

https://docs.python.org/3/library/subprocess.html#subprocess.Popen.returncode

代码11表示* nix中的段错误,但os.strerror(11)报告"资源暂时不可用"。因为当我尝试使用python setup.py egg_info时我得到了段错误,所以我打赌它是11的第一个(段错误)定义。

如果您的段错误转储核心,如果您正在使用systemd,则可能在/var/lib/systemd/coredump/https://unix.stackexchange.com/a/349433/183163 如果找不到核心,请检查ulimit -c。如果它报告0,请运行ulimit -c unlimited以启用核心转储。您可以通过ls -rtd /var/lib/systemd/coredump/* | tail -1

获取最新转储文件的完整路径

要阅读转储,您可以使用gdb。例如:

gdb python /var/lib/systemd/coredump/core.python.6146.f06ba728dae74cfbbaf80acb8d392dd5.4477.1524677641000000.lz4