Question: ImportError: cannot import name getoutput (Biopython)
0
gravatar for afbrito
2.6 years ago by
afbrito0
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?

Best,

[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.

/Library/Python/2.7/site-packages/selenium-2.48.0-py2.7.egg
    from Bio import Phylo
/Library/Python/2.7/site-packages/ete2-2.3.10-py2.7.egg
  File "/Library/Python/2.7/site-packages/Bio/Phylo/__init__.py", line 11, in <module>
/Library/Python/2.7/site-packages
    from Bio.Phylo._io import parse, read, write, convert
/Users/anderson/boxsync/PhD/courses/computing/misc
  File "/Library/Python/2.7/site-packages/Bio/Phylo/_io.py", line 13, in <module>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
    from Bio import File
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
  File "/Library/Python/2.7/site-packages/Bio/File.py", line 28, in <module>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
    from Bio._py3k import basestring
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
  File "/Library/Python/2.7/site-packages/Bio/_py3k/__init__.py", line 267, in <module>
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
    from commands import getoutput
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
ImportError: cannot import name getoutput
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
/Users/anderson/Library/Python/2.7/lib/python/site-packages
/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC
/Library/Python/2.7/site-packages
/Library/modeller-9.15/lib/mac10v4
/Library/modeller-9.15/modlib
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
1

I agree, from commands import getoutput is failing on something that Python 2.7 should come with https://docs.python.org/2/library/commands.html#commands.getoutput

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

Help
Access

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