[解决]ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory

ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory

>>> import mglearn
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/study/anaconda3/lib/python3.7/site-packages/mglearn/__init__.py", line 1, in 
    from . import plots
  File "/usr/study/anaconda3/lib/python3.7/site-packages/mglearn/plots.py", line 1, in 
    from .plot_linear_svc_regularization import plot_linear_svc_regularization
  File "/usr/study/anaconda3/lib/python3.7/site-packages/mglearn/plot_linear_svc_regularization.py", line 3, in 
    from sklearn.svm import LinearSVC
  File "/usr/study/anaconda3/lib/python3.7/site-packages/sklearn/__init__.py", line 134, in 
    from .base import clone
  File "/usr/study/anaconda3/lib/python3.7/site-packages/sklearn/base.py", line 13, in 
    from .utils.fixes import signature
  File "/usr/study/anaconda3/lib/python3.7/site-packages/sklearn/utils/__init__.py", line 10, in 
    from .validation import (as_float_array,
  File "/usr/study/anaconda3/lib/python3.7/site-packages/sklearn/utils/validation.py", line 18, in 
    from ..utils.fixes import signature
  File "/usr/study/anaconda3/lib/python3.7/site-packages/sklearn/utils/fixes.py", line 144, in 
    from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
  File "/usr/study/anaconda3/lib/python3.7/site-packages/scipy/sparse/linalg/__init__.py", line 117, in 
    from .eigen import *
  File "/usr/study/anaconda3/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/__init__.py", line 11, in 
    from .arpack import *
  File "/usr/study/anaconda3/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/__init__.py", line 22, in 
    from .arpack import *
  File "/usr/study/anaconda3/lib/python3.7/site-packages/scipy/sparse/linalg/eigen/arpack/arpack.py", line 45, in 
    from . import _arpack
ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory

更新scipy

pip uninstall scipy
pip install scipy

即可。

你可能感兴趣的:(机器学习)