libgfortran.so.4:无法打开共享对象文件:没有这样的文件或目录

时间:2018-04-28 07:07:32

标签: python-2.7 anaconda

你能帮助我摆脱这些错误吗?当我试图解决它时,这是一场噩梦。错误在哪里?

 File "/project/6008168/tamouze/Python_directory/lda2vec/examples/twenty_newsgroups/lda2vec/lda2vec_run.py", line 18, in <module>
    from lda2vec import utils
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/lda2vec/__init__.py", line 3, in <module>
    import tracking
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/lda2vec/tracking.py", line 2, in <module>
    from sklearn.linear_model import LinearRegression
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scikit_learn-0.19.1-py2.7-linux-x86_64.egg/sklearn/__init__.py", line 134, in <module>
    from .base import clone
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scikit_learn-0.19.1-py2.7-linux-x86_64.egg/sklearn/base.py", line 13, in <module>
    from .utils.fixes import signature
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scikit_learn-0.19.1-py2.7-linux-x86_64.egg/sklearn/utils/__init__.py", line 11, in <module>
    from .validation import (as_float_array,
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scikit_learn-0.19.1-py2.7-linux-x86_64.egg/sklearn/utils/validation.py", line 18, in <module>
    from ..utils.fixes import signature
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scikit_learn-0.19.1-py2.7-linux-x86_64.egg/sklearn/utils/fixes.py", line 144, in <module>
    from scipy.sparse.linalg import lsqr as sparse_lsqr  # noqa
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scipy-1.1.0rc1-py2.7-linux-x86_64.egg/scipy/sparse/linalg/__init__.py", line 114, in <module>
    from .isolve import *
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scipy-1.1.0rc1-py2.7-linux-x86_64.egg/scipy/sparse/linalg/isolve/__init__.py", line 6, in <module>
    from .iterative import *
  File "/home/tamouze/anaconda2/envs/testing-env/lib/python2.7/site-packages/scipy-1.1.0rc1-py2.7-linux-x86_64.egg/scipy/sparse/linalg/isolve/iterative.py", line 10, in <module>
    from . import _iterative
ImportError: libgfortran.so.4: cannot open shared object file: No such file or directory

我正致力于以下系统:

Linux cdr352.int.cedar.computecanada.ca 3.10.0-693.11.6.el7.x86_64 #1 SMP Thu Jan 4 01:06:37 UTC 2018 x86_64 GNU/Linux

Distributor ID: CentOS
Description:    CentOS Linux release 7.4.1708 (Core)
Release:        7.4.1708
Codename:       Core

它是一个ssh服务器。

2 个答案:

答案 0 :(得分:0)

  

CentOS 7.4.1708

/etc/yum.repos.d/CentOS-CR.repo是一个文本文件:请将enabled=0修改为enabled=1 ......(示例:# gedit /etc/yum.repos.d/CentOS-CR.repo

然后你可以:# yum install libgfortran4

所有默认仓库http://mirror.centos.org/centos/7.4.1708/

CR.repo http://mirror.centos.org/centos/7.4.1708/cr/x86_64/Packages/

编辑2019:libgfortran4现在处于默认仓库→# yum install libgfortran4将使用默认仓库条目。

答案 1 :(得分:-1)

这是因为尚未安装包括libgfortran在内的包含fortran的gcc。

通过运行以下命令    apt-get安装gfortran

最有可能解决该问题。