CENTOS7 Python3.7安装 scipy

出现错误

g++: scipy/sparse/sparsetools/csr.cxx
g++: scipy/sparse/sparsetools/csc.cxx
/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/distutils/system_info.py:625: UserWarning: 
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  self.calc_info()
Running from scipy source directory.
/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/distutils/system_info.py:717: UserWarning: Specified path /usr/local/include/python3.7m is invalid.
  return self.get_paths(self.section, key)
/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/distutils/system_info.py:717: UserWarning: Specified path /usr/include/python3.7m is invalid.
  return self.get_paths(self.section, key)
In file included from /usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include/numpy/ndarraytypes.h:1821:0,
                 from /usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include/numpy/ndarrayobject.h:18,
                 from scipy/sparse/sparsetools/sparsetools.h:5,
                 from scipy/sparse/sparsetools/csc.cxx:4:
/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/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 " \
  ^
In file included from /usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include/numpy/ndarraytypes.h:1821:0,
                 from /usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include/numpy/ndarrayobject.h:18,
                 from scipy/sparse/sparsetools/sparsetools.h:5,
                 from scipy/sparse/sparsetools/csc.cxx:4:
/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/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 " \
  ^
In file included from /usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include/numpy/ndarraytypes.h:1821:0,
                 from /usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include/numpy/ndarrayobject.h:18,
                 from scipy/sparse/sparsetools/sparsetools.h:5,
                 from scipy/sparse/sparsetools/csr.cxx:4:
/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/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 " \
  ^
error: Command "g++ -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -D__STDC_FORMAT_MACROS=1 -Iscipy/sparse/sparsetools -I/usr/local/python370/lib/python3.7/site-packages/numpy-1.15.2-py3.7-linux-aarch64.egg/numpy/core/include -I/usr/local/python370/include/python3.7m -c scipy/sparse/sparsetools/csc.cxx -o build/temp.linux-aarch64-3.7/scipy/sparse/sparsetools/csc.o -MMD -MF build/temp.linux-aarch64-3.7/scipy/sparse/sparsetools/csc.o.d" failed with exit status -15

解决:是因为资源不足问题。

1、下载到本地,使用python3.7 setup.py install编译

2、加大swap区

3、一部分一部分的编译,在遇到

g++: scipy/sparse/sparsetools/csr.cxx
g++: scipy/sparse/sparsetools/csc.cxx
g++: scipy/sparse/sparsetools/bsr.cxx

bsr,csr,csc并行编译时共计6个进程(每一个启动两个进程),

(1)先kill掉四个(每个会有两个进程),编译成功一个。

(2)然后重新编译,会有4个进程,kill掉相关的两个,等待其中一个编译完成。

(3)然后再次重新编译,只有2个进程了,顺利编译完成。

4、一定要重启!一定要重启!一定要重启!否则直接运行python3.7 ,然后import scipy会报错。

5、监控内存的脚本

while true; do free -m; sleep 3; done

 

转载于:https://my.oschina.net/mengyoufengyu/blog/2250995

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值