我正在尝试在我没有 root 权限的 64 位 Red Hat Enterprise 6.6 服务器上安装 Scikit-Learn。我已经完成了 Python 2.7.9、Numpy 1.9.2、Scipy 0.15.1 和 Scikit-Learn 0.16.1 的全新安装。服务器上的 Atlas BLAS 安装为 3.8.4。
我可以安装 scikit-learn,但是当我尝试在 Python 中导入它时,我得到了
File "<pyinstall>/site-packages/scipy/parse/linalg/isolve/_iterative.so: undefined symbol: slamch_"
同样,当我跑步时
>>> import scipy; scipy.test()
我收到 16 个错误,其中 14 个为以下未定义符号的 ImportErrors:
scipy/cluster/_vq.so: undefined symbol _gfortran_st_write_done
scipy/special/_ufuncs.so: undefined symbol dstevr_
scipy/linalg/_fblas.so: undefined symbol csyr_
scipy/lib/blas/fblas.so: undefined symbol slamch_
scipy/lib/lapack/flapack.so: undefined symbol sgbsv_
scipy/spatial/qhull.so: undefined symbol _gfortran_st_write_done
我的研究 我发现的几个来源表明,由于在编译 BLAS/LAPack 库和 scipy 时 Fortran 编译器不匹配,例如这个邮件交换和 2007 年的另一个(未链接,因为我的声誉不够高包括另一个链接;它引用了 _gfortran_st_write_done 符号)。但是,BLAS 构建是在只安装了 gfortran(没有 g77 或 Intel 编译器)的服务器上完成的,我重新编译了 scipy 以明确使用 gfortran。
scipy安装说明还提到Atlas BLAS自带的LAPACK版本不是完整的实现,并且说如果安装的LAPACK缺少某些功能可能会出现ImportErrors。所以,我按照这里的说明安装了 LAPACK 3.5.0 的完整版,也是用 gfortran 编译的。然后我重新编译 scipy 和 sklearn 指向更新的库,并收到相同的导入错误。
我的问题 除了不匹配的 Fortran 编译器之外,还有什么可能导致这些错误的吗?或者,我需要重新编译另一个库吗?