简体   繁体   English

Scipy和Scikit中未定义的符号 - 在RedHat上学习

[英]Undefined symbols in Scipy and Scikit-learn on RedHat

I'm trying to install Scikit-Learn on a 64-bit Red Hat Enterprise 6.6 server on which I don't have root privileges. 我正在尝试在没有root权限的64位Red Hat Enterprise 6.6服务器上安装Scikit-Learn。 I've done a fresh installation of Python 2.7.9, Numpy 1.9.2, Scipy 0.15.1, and Scikit-Learn 0.16.1. 我已经完成了Python 2.7.9,Numpy 1.9.2,Scipy 0.15.1和Scikit-Learn 0.16.1的全新安装。 The Atlas BLAS installation on the server is 3.8.4. 服务器上的Atlas BLAS安装是3.8.4。

I can install scikit-learn, but when I attempt to import it in Python, I get 我可以安装scikit-learn,但是当我尝试用Python导入它时,我得到了

File "<pyinstall>/site-packages/scipy/parse/linalg/isolve/_iterative.so: undefined symbol: slamch_"

Similarly, when I run 同样,当我跑

>>> import scipy; scipy.test()

I get 16 errors, 14 of them ImportErrors for the following undefined symbols: 我得到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

My research Several sources I've found suggest that issues like this occur because of a mismatched Fortran compiler in compiling the BLAS/LAPack libraries and scipy, eg this mail exchange and another from 2007 (not linked because my reputation isn't high enough to include another link; it referenced the _gfortran_st_write_done symbol). 我的研究我发现有几个来源提出这样的问题是因为Fortran编译器在编译BLAS / LAPack库和scipy时不匹配,例如这个邮件交换和2007年的另一个(没有链接,因为我的声誉不够高包含另一个链接;它引用了_gfortran_st_write_done符号)。 However, the BLAS build was done on a server that only has gfortran installed (no g77 or Intel compilers), and I recompiled scipy to explicitly use gfortran. 但是,BLAS构建是在只安装了gfortran的服务器上完成的(没有g77或Intel编译器),我重新编译scipy以明确使用gfortran。

The scipy installation notes also mention that the LAPACK version that comes with Atlas BLAS is not a full implementation, and says that ImportErrors may occur if the installed LAPACK is missing some functions. scipy安装说明还提到Atlas BLAS附带的LAPACK版本不是完整的实现,并且如果安装的LAPACK缺少某些功能,则可能会出现ImportErrors。 So, I followed the instructions here to install the full version of LAPACK 3.5.0, also compiled with gfortran. 所以,我按照这里的说明安装了完整版的LAPACK 3.5.0,也是用gfortran编译的。 I then recompiled scipy and sklearn pointed at the updated libraries, and received the same import errors. 然后我重新编译scipy和sklearn指向更新的库,并收到相同的导入错误。

My question Is there anything that might be causing these errors other than mismatched Fortran compilers? 我的问题除了不匹配的Fortran编译器之外,还有什么可能导致这些错误吗? Alternatively, is there another library I need to be recompiling? 或者,是否有另一个我需要重新编译的库?

感谢Andreas Mueller提示:在本地安装的anaconda安装到我所拥有的目录中解决了编译问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM