我正在尝试在没有 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 编译器不匹配,例如这个邮件交换 http://mail.scipy.org/pipermail/scipy-user/2009-January/019411.html另一个来自 2007 年(未链接,因为我的声誉不够高,无法包含另一个链接;它引用了 _gfortran_st_write_done 符号)。然而,BLAS 构建是在仅安装了 gfortran 的服务器上完成的(没有 g77 或 Intel 编译器),并且我重新编译了 scipy 以显式使用 gfortran。
scipy安装说明中还提到Atlas BLAS自带的LAPACK版本并不是完整的实现,并表示如果安装的LAPACK缺少某些功能可能会出现ImportErrors。所以,我按照说明进行操作here http://math-atlas.sourceforge.net/errata3.8.4.html#completelp安装 LAPACK 3.5.0 的完整版本,也是用 gfortran 编译的。然后我重新编译 scipy 和 sklearn 指向更新的库,并收到相同的导入错误。
我的问题除了不匹配的 Fortran 编译器之外,还有什么可能导致这些错误吗?或者,是否还有另一个库需要重新编译?
谢谢安德烈亚斯·穆勒 https://stackoverflow.com/users/676634/andreas-mueller提示:进行本地安装anaconda http://docs.continuum.io/anaconda/index.html到我拥有的目录解决了编译问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)