【问题标题】:ImportError: cannot import name _aligners [biopython]ImportError:无法导入名称 _aligners [biopython]
【发布时间】:2018-07-12 01:06:39
【问题描述】:

我正在做具有 biopython 依赖性的生物信息学。 Biopython 总是给我以下错误:

我希望有人可以帮助我解决这个问题。谢谢!

【问题讨论】:

  • 您使用的是什么操作系统?这是在 Ubuntu 上吗?
  • 嗨 Gino 和 Chris,我在虚拟机上使用 ubuntu 18.04。我查看了链接,但它超出了我的想象。我真的没有任何编程背景。我会咨询专家,当我得到答案时会回复这个问题。
  • 你能试试 `/usr/bin/python' 然后 'rom Bio.Align import aligners' 和 'import Bio' 然后 'Bio.__version_' 并添加你的问题的输出?

标签: python import bioinformatics importerror biopython


【解决方案1】:

在安装另一个软件包期间安装 biopython(作为依赖项)时,我遇到了这个问题。解决方案:

pip uninstall biopython
pip install biopython

【讨论】:

    【解决方案2】:

    这可能发生在 Biopython 版本 >= 1.72 上,并已在 biopython mailing list here 上进行了讨论。当您在 biopython/ 目录中尝试导入时会发生此错误,要修复错误只需移动到源代码树之外的另一个目录,然后执行您的代码。

    如果错误仍然出现,则可能安装设置不正确,您可以尝试运行以下标准安装步骤(假设您没有使用pip)将文件和目录放在正确的位置:

    python setup.py build
    python setup.py test  # not compulsory for the fix
    python setup.py install  # add '--prefix' flag to install to a particular directory
    

    我们已经改进了未来 biopython 版本的回溯,请参阅8efbf6d

    ImportError: cannot import name '_aligners': you should not import directly from the biopython source directory; please exit the source tree and re-launch your code from there
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-31
      • 2014-10-10
      • 2014-09-20
      • 2014-08-28
      • 2014-06-10
      • 2016-05-16
      • 2019-05-25
      • 2017-04-22
      相关资源
      最近更新 更多