dongzhang0725 / PhyloSuite

PhyloSuite is an integrated and scalable desktop platform for streamlined molecular sequence data management and evolutionary phylogenetics studies
GNU General Public License v3.0
140 stars 24 forks source link

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

Closed NgoTanw closed 2 years ago

NgoTanw commented 3 years ago

Unable to run PhyloSuite after installation. I get an error about Bio.Alphabet for both pip install and installation by source.

[ngotanw@RankA ~]$ PhyloSuite
Traceback (most recent call last):
  File "/usr/bin/PhyloSuite", line 33, in <module>
    sys.exit(load_entry_point('PhyloSuite==1.2.2', 'console_scripts', 'PhyloSuite')())
  File "/usr/bin/PhyloSuite", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/PhyloSuite.py", line 20, in <module>
    from src.main import MyMainWindow
  File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/src/main.py", line 23, in <module>
    from src.Lg_displaySettings import DisplaySettings
  File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/src/Lg_displaySettings.py", line 18, in <module>
    from src.handleGB import ArrayManager
  File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/src/handleGB.py", line 12, in <module>
    from Bio.Alphabet import generic_dna
  File "/home/ngotanw/.local/lib/python3.9/site-packages/Bio/Alphabet/__init__.py", line 20, in <module>
    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.

OS: Arch Linux Python version: 3.9.2 Biopython version: 1.78

dongzhang0725 commented 3 years ago

PhyloSuite is developed in Python 3.6.7, so you may try to install it with python 3.6 or python 3.7. By the way, you may also try the packaged version: http://phylosuite.jushengwu.com/installation_packages/PhyloSuite_v1.2.2_Linux.tar.gz .

NgoTanw @.***> 于2021年3月14日周日 下午5:08写道:

Unable to run PhyloSuite after installation. I get an error about Bio.Alphabet for both pip install and installation by source.

[ngotanw@RankA ~]$ PhyloSuite Traceback (most recent call last): File "/usr/bin/PhyloSuite", line 33, in sys.exit(load_entry_point('PhyloSuite==1.2.2', 'console_scripts', 'PhyloSuite')()) File "/usr/bin/PhyloSuite", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load module = import_module(match.group('module')) File "/usr/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 790, in exec_module File "", line 228, in _call_with_frames_removed File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/PhyloSuite.py", line 20, in from src.main import MyMainWindow File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/src/main.py", line 23, in from src.Lg_displaySettings import DisplaySettings File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/src/Lg_displaySettings.py", line 18, in from src.handleGB import ArrayManager File "/usr/lib/python3.9/site-packages/PhyloSuite-1.2.2-py3.9.egg/PhyloSuite/src/handleGB.py", line 12, in from Bio.Alphabet import generic_dna File "/home/ngotanw/.local/lib/python3.9/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.

OS: Arch Linux Python version: 3.9.2 Biopython version: 1.78

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dongzhang0725/PhyloSuite/issues/24, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZXXOM4EMZOGUXTCDAPW5TTDR4HHANCNFSM4ZEYMELQ .

NgoTanw commented 3 years ago

Downgrading python to 3.7.2 didn't help. But the packaged version is getting things done. Although using the online features returns an SSLError.

HannesOberreiter commented 3 years ago

"Workaround" if you use (mini)conda. Install first an environment with Python 3.6.7, then install PhyloSuite and at last step install the specific version of biopython which still includes alphabet attribute.

# Create Env
conda create -n py36 python=3.6.7
# Activate Env
conda activate py36
# Install PhyloSuite
pip install PhyloSuite
# Overwrite biopython with specific version
pip install biopython==1.68
# Start PhyloSuite
PhyloSuite
# to deactivate environment
conda deactivate

Cheers Hannes

dongzhang0725 commented 3 years ago

Nice input!