簡體   English   中英

Pandas構建在Django AWS Elastic Beanstalk部署上失敗

[英]Pandas build failing on Django AWS Elastic Beanstalk deployment

我以前沒有在我的應用程序中部署更新的問題; 但是,今天我嘗試將我的代碼分支部署到新環境中,並且我一直收到此錯誤:

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中。 有什么改變或我在這里做錯了嗎? 一切都在我當地的環境中運作良好。

我沒有找到很多這個問題的答案,但我找到了一個與類似'gcc'構建相關的帖子和​​這個EOF錯誤。 它建議增加內存,因此我更改了AWS EC2規范並設法構建和部署。 我試圖建立一個t1.micro,並發現我需要將其設置為m1.small。

我想知道如何最好地確定環境構建所需的資源。 我將開始另一個提出這個問題的線索。

另一種方法是啟用一些交換內存。 這導致編譯緩慢但成功。

# 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

我必須做兩件事:

  • 從t2.micro升級到t2.small EC2實例

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

這似乎可以解決問題!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM