biopython / biopython.github.io

Source of biopython.org website, migrated from MediaWiki
biopython.org
154 stars 284 forks source link

ImportError: Bio.Alphabet has been removed from Biopython #197

Closed neelam19051 closed 1 year ago

neelam19051 commented 1 year ago

.Hi, I am facing this error and i followed below instruction also but still unable to solve it. /TnComp_finder.py ./TnComp_finder.py:247: SyntaxWarning: "is" with a literal. Did you mean "=="? if character is 'T': ./TnComp_finder.py:249: SyntaxWarning: "is" with a literal. Did you mean "=="? elif character is 'A': ./TnComp_finder.py:251: SyntaxWarning: "is" with a literal. Did you mean "=="? elif character is 'C': ./TnComp_finder.py:253: SyntaxWarning: "is" with a literal. Did you mean "=="? elif character is 'G': ./TnComp_finder.py:255: SyntaxWarning: "is" with a literal. Did you mean "=="? elif character is 'N': ./TnComp_finder.py:275: SyntaxWarning: "is" with a literal. Did you mean "=="? if item[3] is '+': ./TnComp_finder.py:278: SyntaxWarning: "is" with a literal. Did you mean "=="? elif item[3] is '-': Traceback (most recent call last): File "./TnComp_finder.py", line 31, in from Bio.Alphabet import IUPAC File "/home/bvs/.local/lib/python3.8/site-packages/Bio/Alphabet/init.py", line 20, in raise ImportError( ImportError: Bio.Alphabet has been removed from Biopython. In many cases, the alphabet can simply be ignored and removed from scripts. In a few cases, you may need to specify the molecule_type as an annotation on a SeqRecord for your script to work correctly. Please see https://biopython.org/wiki/Alphabet for more information.

Thank you!

peterjc commented 1 year ago

This repository is for the Biopython website, so the issue does not belong here.

Whoever wrote the TnComp_finder.py code needs to update it not to use the Bio.Alphabet module which we removed in Biopython 1.78. Or in the short term, you can run an older version of Biopython.

See https://github.com/biopython/biopython/blob/master/NEWS.rst