PhyloSuite icon indicating copy to clipboard operation
PhyloSuite copied to clipboard

Launch error caused by a deprecated library(Bio.Alphbet)

Open cyclinbox opened this issue 1 year ago • 3 comments

I installed PhyloSuite by pip install PhyloSuite and launched it by command PhyloSuite, but the launching has failed and I got the Error message like this:

Traceback (most recent call last):
  File "C:\Users\zhang\anaconda3\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\zhang\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\zhang\anaconda3\Scripts\PhyloSuite.exe\__main__.py", line 4, in <module>
  File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\PhyloSuite.py", line 20, in <module>
    from src.main import MyMainWindow
  File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\src\main.py", line 23, in <module>
    from src.Lg_displaySettings import DisplaySettings
  File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\src\Lg_displaySettings.py", line 18, in <module>
    from src.handleGB import ArrayManager
  File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\src\handleGB.py", line 12, in <module>
    from Bio.Alphabet import generic_dna
  File "C:\Users\zhang\anaconda3\lib\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.

It looks like PhyloSuite uses an old version of Bio.Alphabet API in the Biopython library, but in the latest version of Biopython this API is deprecated. I wonder how to fix this error, thanks!

Addtional information:

Python version: 3.9.7
Biopython version: 1.79
OS: Windows 11 x64 (NT 10.0.22621.1992)

cyclinbox avatar Aug 09 '23 03:08 cyclinbox

Update: I fixed this problem by uninstall the latest version of Biopython and reinstall Biopython 1.77 (lower than 1.77 should work as well but I didn't try)

pip uninstall Biopython
pip install Biopython==1.77

Besides, I also tried Biopython 1.78 and got the same error message as before. So any Biopython version > 1.77 cannot work while version <= 1.77 can work.

cyclinbox avatar Aug 09 '23 03:08 cyclinbox

for installation, refer to here: http://phylosuite.jushengwu.com/dongzhang0725.github.io/installation/#2-Install-using-pip

Wanyu.Zhang @.***> 于2023年8月9日周三 11:10写道:

I installed PhyloSuite by pip install PhyloSuite and launched it by command PhyloSuite, but the launching has failed and I got the Error message like this:

Traceback (most recent call last): File "C:\Users\zhang\anaconda3\lib\runpy.py", line 197, in _run_module_as_main return run_code(code, main_globals, None, File "C:\Users\zhang\anaconda3\lib\runpy.py", line 87, in run_code exec(code, run_globals) File "C:\Users\zhang\anaconda3\Scripts\PhyloSuite.exe_main.py", line 4, in File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\PhyloSuite.py", line 20, in from src.main import MyMainWindow File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\src\main.py", line 23, in from src.Lg_displaySettings import DisplaySettings File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\src\Lg_displaySettings.py", line 18, in from src.handleGB import ArrayManager File "C:\Users\zhang\anaconda3\lib\site-packages\PhyloSuite\src\handleGB.py", line 12, in from Bio.Alphabet import generic_dna File "C:\Users\zhang\anaconda3\lib\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.

It looks like PhyloSuite uses an old version of Bio.Alphabet API in the Biopython library, but in the latest version of Biopython this API is deprecated. I wonder how to fix this error, thanks!

— Reply to this email directly, view it on GitHub https://github.com/dongzhang0725/PhyloSuite/issues/80, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZXXOIPCDVP4KPXZSEK2FTXUL5R5ANCNFSM6AAAAAA3JLD5XA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

dongzhang0725 avatar Aug 09 '23 04:08 dongzhang0725

@cyclinbox Yes, you are right, as recorded in the installation page, if you use python 3.6, pip install PhyloSuite will work, and Biopython v1.77 will be selected to install.

Dong

dongzhang0725 avatar Aug 10 '23 02:08 dongzhang0725