【问题标题】:Pandas build failing on Django AWS Elastic Beanstalk deploymentPandas 在 Django AWS Elastic Beanstalk 部署上构建失败
【发布时间】:2013-09-23 09:33:51
【问题描述】:

我之前没有遇到过向我的应用程序部署更新的问题;但是,今天我尝试将我的代码的一个分支部署到一个新环境中,但我一直收到此错误:

building 'pandas.algos' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Ipandas/src/klib -Ipandas/src -I/opt/python/run/venv/lib/python2.6/site-packages/numpy/core/include -I/usr/include/python2.6 -c pandas/algos.c -o build/temp.linux-x86_64-2.6/pandas/algos.o

In file included from /opt/python/run/venv/lib/python2.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from /opt/python/run/venv/lib/python2.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /opt/python/run/venv/lib/python2.6/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/algos.c:314: /opt/python/run/venv/lib/python2.6/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"

pandas/algos.c: In function __pyx_pf_6pandas_5algos_450group_ohlc_float64:
.... (other warnings)
pandas/algos.c:118189: warning: __pyx_v_vclose may be used uninitialized in this function

{standard input}: Assembler messages:
{standard input}:2324793: Warning: end of file in string; '"' inserted
....
gcc: Internal error: Killed (program cc1)
error: command 'gcc' failed with exit status 1

我还看到了错误的不同叙述:

{standard input}:78968: Warning: end of file not at end of a line; newline inserted
{standard input}:79677: Error: open CFI at the end of file; missing .cfi_endproc directive

Pandas 0.12.0(和 NumPy 1.7.1 等)都包含在我的 requirements.txt 中。有什么改变还是我在这里做错了什么?在我的本地环境中一切正常。

【问题讨论】:

    标签: python amazon-ec2 pandas


    【解决方案1】:

    我没有找到很多关于这个问题的答案,但我确实找到了一篇与类似的“gcc”构建和这个 EOF 错误相关的帖子。它建议增加内存,所以我更改了 AWS EC2 规范并设法构建和部署。我正在尝试构建一个 t1.micro,发现我需要将它提升到一个 m1.small。

    我想知道如何才能最好地确定我的环境构建所需的资源。我将开始另一个线程,将其作为一个问题。

    【讨论】:

    • 谢谢,这个解决方案非常适合我。我可能会建议将您的“django”标签更改为“python”标签,因为这与 Django 并没有真正的关系。我实际上是在 Amazon EC2 上运行 Flask,但这个解决方案正是我所需要的。此外,我能够升级到更高的层,运行安装,然后降级回 t1.small。我能够毫无问题地运行“import pandas”。
    • @alexpmil 是的,我做了同样的事情。升级,安装,然后降级。无论如何,我现在在 m3.large 上运行,所以这不是问题。
    【解决方案2】:

    另一种方法是启用一些交换内存。这会导致编译缓慢但成功。

    # create 2 GB swap
    dd if=/dev/zero of=/var/swap.1 bs=1M count=2048
    # format 
    mkswap /var/swap.1
    # turn on swap memory
    swapon /var/swap.1
    

    您可以将以下行添加到 /etc/fstab 以在重新启动后启用交换

    /var/swap.1 swap swap defaults 0 0 to /etc/fstab
    

    我不确定交换文件的逻辑位置是什么。通常你会使用一个单独的分区。我见过其他人使用/swapfile

    【讨论】:

      【解决方案3】:

      我必须同时做:

      • 从 t2.micro 升级到 t2.small EC2 实例

      • yum: gcc-c++: [] python27-devel: []
        在我的 .ebextensions/whatever.config 中

      这似乎可以解决问题!

      【讨论】:

        猜你喜欢
        • 2015-12-15
        • 2015-06-13
        • 2017-01-29
        • 2016-06-19
        • 2017-01-24
        • 2020-03-24
        • 2020-10-08
        • 1970-01-01
        • 2021-06-21
        相关资源
        最近更新 更多