4

I am doing bioinformatics that has biopython dependency. Biopython always give me the following error: enter image description here

I hope someone could help me with this issue. Thank you!

Chris_Rands
  • 38,994
  • 14
  • 83
  • 119
jcampecino
  • 41
  • 1
  • 2
  • 1
    What OS are you using? Is this on Ubuntu? – Gino Mempin Jul 12 '18 at 01:19
  • Hi Gino and Chris, I use ubuntu 18.04 on a virtual box. I checked out the link but it was way over my head. I don't really have any programming background. I'd consult an expert and will get back to this when I get an answer. – jcampecino Jul 12 '18 at 21:49
  • Can you try `/usr/bin/python' and then 'rom Bio.Align import _aligners' and 'import Bio' and then 'Bio.__version__' and add the output to your question? – Maximilian Peters Jul 13 '18 at 16:14

2 Answers2

1

I had a problem with this when biopython (as a dependency) was installed during the installation of another package. Solution:

pip uninstall biopython
pip install biopython
Peter
  • 225
  • 3
  • 8
0

This can occur on Biopython version >= 1.72 and has been discussed on the biopython mailing list here. This error occurs when you try and import while inside the biopython/ directory, to fix the error simply move to another directory outside the source tree and then execute your code.

If the error still occurs then likely the install has not been setup properly, and you can try running the following standard installation steps (assuming you have not used pip) to get the files and directories in the correct places:

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

We have improved the traceback for future biopython releases, see 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
Chris_Rands
  • 38,994
  • 14
  • 83
  • 119