Edinburgh-Genome-Foundry / DnaFeaturesViewer

:eye: Python library to plot DNA sequence features (e.g. from Genbank files)
https://edinburgh-genome-foundry.github.io/DnaFeaturesViewer/
MIT License
584 stars 90 forks source link

Bio.Alphabet #48

Closed ZarulHanifah closed 2 years ago

ZarulHanifah commented 3 years ago

Hello,

I can't import BiopythonTranslator from dna_features_viewer

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-26-8cd547d411a9> in <module>
     10 from matplotlib.patches import Patch
     11 from matplotlib.lines import Line2D
---> 12 from dna_features_viewer import BiopythonTranslator
     13 from Bio import SeqIO, Entrez
     14 from BCBio import GFF

~/Zarul/Software/anaconda3/envs/dna/lib/python3.6/site-packages/dna_features_viewer/__init__.py in <module>
      1 """ dna_features_viewer/__init__.py """
      2 
----> 3 from .GraphicRecord import GraphicRecord
      4 from .CircularGraphicRecord import CircularGraphicRecord
      5 from .GraphicFeature import GraphicFeature

~/Zarul/Software/anaconda3/envs/dna/lib/python3.6/site-packages/dna_features_viewer/GraphicRecord/__init__.py in <module>
----> 1 from .GraphicRecord import GraphicRecord
      2 
      3 __all__ = ['GraphicRecord']

~/Zarul/Software/anaconda3/envs/dna/lib/python3.6/site-packages/dna_features_viewer/GraphicRecord/GraphicRecord.py in <module>
      4 from Bio.SeqRecord import SeqRecord
      5 from Bio.SeqFeature import FeatureLocation, SeqFeature
----> 6 from Bio.Alphabet import DNAAlphabet
      7 
      8 from .MatplotlibPlottableMixin import MatplotlibPlottableMixin

~/Zarul/Software/anaconda3/envs/dna/lib/python3.6/site-packages/Bio/Alphabet/__init__.py in <module>
     19 
     20 raise ImportError(
---> 21     "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."
     22 )

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.

What do I do now?

veghp commented 3 years ago

Which version of Biopython and dna_features_viewer are you using? You can see the package versions with pip list. Biopython 1.78 has removed the alphabet so please update dna_features_viewer to v3.0.3: pip install --upgrade dna_features_viewer

ZarulHanifah commented 3 years ago

Thank you! It works now.