scikit-learnインストール時のエラー対策2
スポンサーリンク
以前,scikit-learnインストール時のエラー対策で
CentOS7にnumpy-1.10.1
+ scikit-learn-0.16.1
の環境を構築した時に以下のエラーが発生し,numpyを1.9.3にすることでエラーを回避した.
(VENV)$ pip isntall scikit-learn ... /usr/bin/ld: cannot find -lcblas collect2: error: ld returned 1 exit status /usr/bin/ld: cannot find -lcblas collect2: error: ld returned 1 exit status error: Command "g++ -pthread -shared build/temp.linux-x86_64-2.7/sklearn/svm/liblinear.o build/temp.linux-x86_64-2.7/sklearn/svm/src/liblinear/tron.o build/temp.linux-x86_64-2.7/sklearn/svm/src/liblinear/linear.o -L/usr/lib64/atlas -Lbuild/temp.linux-x86_64-2.7 -lcblas -lm -o build/lib.linux-x86_64-2.7/sklearn/svm/liblinear.so" failed with exit status 1
今回,numpy-1.10.4
+ scikit-learn-0.17
でも同様のエラーが発生した.
調べてみると,下のページが見つかった
cblasはatlasの中にあるそうなので
$ ln -s /usr/lib64/atlas/libsatlas.so /usr/lib64/atlas/libcblas.so
とすればいいらしいのでやってみると
(VENV)$ pip install scikit-learn Collecting scikit-learn Using cached scikit-learn-0.17.tar.gz Building wheels for collected packages: scikit-learn Running setup.py bdist_wheel for scikit-learn Stored in directory: /root/.cache/pip/wheels/f6/4e/d3/9f5a279531fddfc7fa3979adb24041323e4fb7421756261921 Successfully built scikit-learn Installing collected packages: scikit-learn Successfully installed scikit-learn-0.17
うまくいった.