Question: ImportError: cannot import name getoutput (Biopython)
gravatar for afbrito
2.6 years ago by
afbrito0 wrote:

Dear all,

Could you please give me any help on how to deal with the error below. It concerns the package Bio._py3k, and occurs specifically at the last line of this package, failing to import getoutput.

I've tried to uninstall Biopython and reinstall different versions of it in order to fix the problem, however it was not successful. My last attempt was with Version 1.67. Seemingly, the other biopython packages are working fine, and only Phylo shows such problem.

I'm running Biopython on a Mac OSX Yosemite (10.10), python 2.7, biopython 1.68

What's the best solution for that?


[EDIT] I've just installed Python 3.6 and biopython 1.68, and the package could be imported without errors. However, with python 2.7 the problem persists.

    from Bio import Phylo
  File "/Library/Python/2.7/site-packages/Bio/Phylo/", line 11, in <module>
    from Bio.Phylo._io import parse, read, write, convert
  File "/Library/Python/2.7/site-packages/Bio/Phylo/", line 13, in <module>
    from Bio import File
  File "/Library/Python/2.7/site-packages/Bio/", line 28, in <module>
    from Bio._py3k import basestring
  File "/Library/Python/2.7/site-packages/Bio/_py3k/", line 267, in <module>
    from commands import getoutput
ImportError: cannot import name getoutput
importerror biopython python • 1.7k views
ADD COMMENTlink modified 2.6 years ago • written 2.6 years ago by afbrito0

You appear to have a problem with your python installation that is only being evidenced because biopython is trying to use a standard package that you don't have.

ADD REPLYlink written 2.6 years ago by Devon Ryan91k

I agree, from commands import getoutput is failing on something that Python 2.7 should come with

ADD REPLYlink written 2.5 years ago by Peter5.8k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1482 users visited in the last hour