gpt4 book ai didi

python - 在 Amazon Linux 上安装 Scipy 时出错

转载 作者:IT王子 更新时间:2023-10-29 01:21:08 27 4
gpt4 key购买 nike

我在 Amazon Linux 上从 this link 安装 scipy 模块时遇到了这个错误:

(sk-learn)[root@ip-161-31-0-289 ec2-user]# pip install scipy

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

/home/ec2-user/sk-learn/local/lib/python2.7/dist-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]

#warning "Using deprecated NumPy API, disable it by " \

^

{standard input}: Assembler messages:

{standard input}:374818: Warning: end of file not at end of a line; newline inserted

{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive

g++: internal compiler error: Killed (program cc1plus)

Please submit a full bug report,

with preprocessed source if appropriate.

See http://bugzilla.redhat.com/bugzilla for instructions.

error: Command "g++ -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 -D__STDC_FORMAT_MACROS=1 -Iscipy/sparse/sparsetools -I/home/ec2-user/sk-learn/local/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c scipy/sparse/sparsetools/bsr.cxx -o build/temp.linux-x86_64-2.7/scipy/sparse/sparsetools/bsr.o" failed with exit status 4

---------------------------------------- Cleaning up... Command /home/ec2-user/sk-learn/bin/python27 -c "import setuptools, tokenize;file='/home/ec2-user/sk-learn/build/scipy/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-SIVe3Y-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/sk-learn/include/site/python2.7 failed with error code 1 in /home/ec2-user/sk-learn/build/scipy

最佳答案

增加交换内存就可以了

dd if=/dev/zero of=/swapfile bs=128M count=8
mkswap /swapfile
swapon /swapfile

swapon -s 会给你一个使用总结

关于python - 在 Amazon Linux 上安装 Scipy 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33952127/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com