Centos6.5安裝 scipy sciki-learn 一堆報錯

   最近給業務線安裝python的擴展numpy,scripy,scikit-learn時,遇到了一堆報錯,也走了一些彎路,費了好長時間,最好發現居然是一個很簡單的問題。python

系統環境:Centos 6.5centos

Python: 2.7ide

  pip install numpy 很順利,沒有報錯測試

  pip install scipy 一堆報錯,報錯大體以下spa

Installing scipy on redhat with error 「no lapack/blas resources found」blog

而後就開始百度,說是手動安裝 lapack,atlas包ip

下載了源碼包,按照文檔開始編譯,編譯 atlas居然一堆報錯,截圖以下ci

wKioL1bWn7KhY_u1AABlxTIqxz8568.png嘗試了所能找到的方法,依然報錯文檔

   偶然間看到一篇文章,如是說get

  scikit-learn 的安裝必需要幾個包的支持, 一個是lapack, nose 和atlas ,不過安裝須要配置好幾個小時,還很容易出錯,因此後來想了其餘方法。我只是裝個scipy, 不必把整個atlas 包都裝上,只須要下載相應的支持就能夠,相應的支持就是 devel包,blas-devel lapack-devel atlas-devel,因而趕忙下載

wget http://mirror.centos.org/centos/6/os/x86_64/Packages/lapack-devel-3.2.1-4.el6.x86_64.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/blas-devel-3.2.1-4.el6.x86_64.rpm
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/texinfo-tex-4.13a-8.el6.x86_64.rpm
wget 
後面兩個是其相關依賴包。
yum localinstall *.rpm

以後 

pip install scipy   成功了
pip install scikit-learn 也OK了
好了,大功告成!在python中測試一下:
>>>import sklearn
>>>import scipy   沒有報錯,安裝成功。
相關文章
相關標籤/搜索