问题
I am doing bioinformatics that has biopython dependency. Biopython always give me the following error:
I hope someone could help me with this issue. Thank you!
回答1:
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
来源:https://stackoverflow.com/questions/51296034/importerror-cannot-import-name-aligners-biopython