ProDy
ProDy copied to clipboard
fail to import prody
Python 3.9.12 | packaged by conda-forge | (main, Mar 24 2022, 23:22:55)
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import prody
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/prody/__init__.py", line 66, in <module>
from . import utilities
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/prody/utilities/__init__.py", line 74, in <module>
from .TreeConstruction import *
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/prody/utilities/TreeConstruction.py", line 18, in <module>
from Bio.Phylo.TreeConstruction import _DistanceMatrix as DistanceMatrix
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/Bio/Phylo/TreeConstruction.py", line 360, in <module>
class DistanceCalculator:
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/Bio/Phylo/TreeConstruction.py", line 433, in DistanceCalculator
matrix = substitution_matrices.load(name)
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/Bio/Align/substitution_matrices/__init__.py", line 513, in load
matrix = read(path)
File "/dat1/nbt2/miniconda3/envs/structure/lib/python3.9/site-packages/Bio/Align/substitution_matrices/__init__.py", line 495, in read
matrix[letter1, letter2] = float(word)
ValueError: could not convert string to float: 'A'
>>>
This seems to be a problem with biopython. What version are you using? Can you go down to an earlier version?
I'd also suggest raising this issue with the biopython team at https://github.com/biopython/biopython/issues. They may even have it already. It doesn't look like it but it could be good to double check.
Thanks for your advice, I lowered biopython version to 1.76 and then it just works. by the way, The origin biopython
version is 1.79.
ok. It looks like we set that requirement for python 2.7 but not for python 3. I've updated it at #1547 and then we shouldn't have any problems. Thanks.
Hi, apologies for reopening this issue.
Do we know if the biopython>1.76
incompatibility was ever resolved? I am working with libraries that depend on 1.79
.
It works fine for me locally if I forcibly ignore the requirement from prody
,
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Bio
>>> Bio.__version__
'1.79'
>>> import prody
>>> prody.__version__
'2.2.0'
but I need biopython<=1.76
removed for CI and deployment.
Thanks.
I don’t think we ever did. I can check next week probably
Hi, I just wanted to check if there was any progress on this. Thank you!
No, no progress. Sorry
Have you run the prody tests with biopython 1.79 installed?
It could well be that everything is fine by now and this requirement can be removed, but I really don't know.
Hi! I have run into the same issues as @fcomitani with the necessity of newer versions of biopython incompatible with prody.
The biopython restriction makes sense for older pythons due to support limitations. It should answer this.
Version 1.76 is the last release to support Python 2.7 and 3.5, all later releases require Python 3.6 or greater
But for python 3.6+ the more recent biopython packages available should work flawlessly with prody. I ran the CI tests after removing the restrictions and everything seems fine.
I suggest to just revert the biopython restrictions for python 3.
Ok. We can probably remove support and CI for python 3.5 as basically no one uses it anyway. Thanks very much
Hi, apologies I forgot to follow through. I ended up downgrading to v2.1.0 for my project, but support for future versions would be great. Thanks both for the help!
It still would be good to know what caused the original import error but the fact that so many people failed to reproduce it is reassuring
I have now made a pull request that should address this (#1595). Thanks to all of you for the feedback
Hi! I have run into the same issues as @fcomitani with the necessity of newer versions of biopython incompatible with prody.
The biopython restriction makes sense for older pythons due to support limitations. It should answer this.
Version 1.76 is the last release to support Python 2.7 and 3.5, all later releases require Python 3.6 or greater
But for python 3.6+ the more recent biopython packages available should work flawlessly with prody. I ran the CI tests after removing the restrictions and everything seems fine.
I suggest to just revert the biopython restrictions for python 3.
I now found that Biopython 1.76 doesn't even install with Python 3.11
I am currently running tests on ProDy installed in a Python 3.11 environment with Biopython 1.77 and will try others after that
I think we also need to delete or modify pyproject.toml and that forced Biopython 1.76 still. Does anyone have any views on that?
ok, 1.76, 1.77, 1.78 and 1.79 all pass the tests. The GitHub Actions continuous integration tests are also using 1.79
and the installation works fine on Windows and Ubuntu without pyproject.toml and it was added fairly recently so I guess removing it is fine and I have done it in #1616