无法安装scikit learn




我想安装scikit-learn,但我做不到。我使用最新的Fedora。要安装scikit,请学习我的操作。

pip install scikit-learn

我收到错误:

    g++ -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-3.4/sklearn/svm/liblinear.o build/temp.linux-x86_64-3.4/sklearn/svm/src/liblinear/tron.o build/temp.linux-x86_64-3.4/sklearn/svm/src/liblinear/linear.o -L/usr/lib64/atlas -L/usr/lib64 -Lbuild/temp.linux-x86_64-3.4 -lcblas -lm -lpython3.4m -o build/lib.linux-x86_64-3.4/sklearn/svm/liblinear.cpython-34m.so
    /usr/bin/ld: cannot find -lcblas
    collect2: error: ld returned 1 exit status
    Partial import of sklearn during the build process.
    error: Command "g++ -pthread -shared -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld build/temp.linux-x86_64-3.4/sklearn/svm/liblinear.o build/temp.linux-x86_64-3.4/sklearn/svm/src/liblinear/tron.o build/temp.linux-x86_64-3.4/sklearn/svm/src/liblinear/linear.o -L/usr/lib64/atlas -L/usr/lib64 -Lbuild/temp.linux-x86_64-3.4 -lcblas -lm -lpython3.4m -o build/lib.linux-x86_64-3.4/sklearn/svm/liblinear.cpython-34m.so" failed with exit status 1
    /usr/bin/ld: cannot find -lcblas
    collect2: error: ld returned 1 exit status
    ----------------------------------------
Command "/home/mstankiewicz/.virtualenvs/sus/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-4scm2pb_/scikit-learn/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('rn', 'n'), __file__, 'exec'))" install --record /tmp/pip-8fh7u6fy-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mstankiewicz/.virtualenvs/sus/include/site/python3.4/scikit-learn" failed with error code 1 in /tmp/pip-build-4scm2pb_/scikit-learn

我试着安装我在谷歌上找到的图集,但它对没有帮助

sudo dnf -y install atlas3gf-base atlas-devel

我在Fedora 24上安装时遇到了类似的问题。

阿特拉斯改变了他们的图书馆。请参阅Fedora邮件列表。

值得庆幸的是,在fedora的回购中有一个包裹,运行:

# dnf install python2-scikit-learn.x86_64

您可能需要先安装一些依赖项。

sudo dnf install atlas lapack atlas-devel blas-devel gcc-gfortran jupyter ipython fftw fftw-devel

编辑:最佳做法是使用虚拟python环境管理。您可以安装Annaconda来完成此操作。

相关内容

  • 没有找到相关文章