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

标签 python linux numpy amazon-web-services amazon-ec2

我在 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/

相关文章:

python - Open3d(Python),如何从 .ply 中删除点

python - 在我的 python 项目中使用我自己的模块的最佳方式

linux - 有人可以解释 '$' 在此命令行示例中的含义吗?

python - 等效的 numpy 脚本产生不同的结果

python - TensorFlow 在实现逻辑回归时返回 nan

python - 使用 Flask 提供 .mp4 文件并在 Objective-C 应用程序上播放会导致管道损坏且无法播放

python - 防御性编程还是浪费时间?

c - malloc 大量数据来填充 ram 并观察自由参数

linux - linux安装jdk的正确方法是什么

numpy - 在 numpy/tensorflow 中向量化不同形状矩阵的乘法