scipy osx 10.9 无法加载 gfortran 库

1 投票
2 回答
1597 浏览
提问于 2025-04-18 11:25

我尝试用pip和brew安装scipy,但两种方式都出现了这个错误:

ImportError: dlopen(/usr/local/lib/python2.7/site-packages/sklearn/linear_model/cd_fast.so, 2): Library not loaded: /usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.3/libgfortran.3.dylib
  Referenced from: /usr/local/lib/python2.7/site-packages/sklearn/linear_model/cd_fast.so
  Reason: image not found

查看出问题的库时,发现有一个不同架构的版本可用:

administrators-iMac-3:sourcefind_python bill$ locate libgfortran.3.dylib
/Applications/MATLAB_R2013a.app/sys/os/maci64/libgfortran.3.dylib
/usr/local/Cellar/gcc/4.8.3_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.3/i386/libgfortran.3.dylib
/usr/local/Cellar/gcc/4.8.3_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.3/libgfortran.3.dylib

我试着在/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.3/libgfortran.3.dylib放一个符号链接,指向usr/local/Cellar/gcc/4.8.3_1/lib/gcc/x86_64-apple-darwin13.2.0/4.8.3/libgfortran.3.dylib,但这给我返回了一个错误,提示'架构不匹配'

有没有人有什么建议可以让这个工作正常?

2 个回答

1

你应该重新安装numpy和scipy这两个库。

1

Scikit-learn正在寻找一个旧版本的Fortran库。你应该重新安装scikit-learn。

撰写回答