在MacO上使用brew安装Octave之后,从scipy加载迭代时,出现以下错误。
In [1]: from scipy.sparse.linalg import iterative
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-10047ea62d81> in <module>()
----> 1 from scipy.sparse.linalg import iterative
~/venv/lib/python3.6/site-packages/scipy/sparse/linalg/__init__.py in <module>()
110 from __future__ import division, print_function, absolute_import
111
--> 112 from .isolve import *
113 from .dsolve import *
114 from .interface import *
~/venv/lib/python3.6/site-packages/scipy/sparse/linalg/isolve/__init__.py in <module>()
4
5 #from info import __doc__
----> 6 from .iterative import *
7 from .minres import minres
8 from .lgmres import lgmres
~/venv/lib/python3.6/site-packages/scipy/sparse/linalg/isolve/iterative.py in <module>()
5 __all__ = ['bicg','bicgstab','cg','cgs','gmres','qmr']
6
----> 7 from . import _iterative
8
9 from scipy.sparse.linalg.interface import LinearOperator
ImportError: dlopen(/venv/lib/python3.6/site-packages/scipy/sparse/linalg/isolve/_iterative.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/gcc/lib/gcc/6/libgfortran.3.dylib
Referenced from: /venv/lib/python3.6/site-packages/scipy/sparse/linalg/isolve/_iterative.cpython-36m-darwin.so
Reason: image not found
我怀疑问题可能是八度更新了gcc,但我不确定。知道这可能是什么吗? 我当前在此虚拟环境中使用scipy 0.17 。
编辑:似乎scipy-.17包含在我安装gcc 8时试图加载gcc 6的代码。如果我从应修复此问题的源安装scipy-0.17,则可能会用gcc 8进行编译。但是,我不确定该怎么做。