Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade pyyaml to support Python 3.10 #863

Closed
Moisan opened this issue Oct 22, 2021 · 13 comments
Closed

Upgrade pyyaml to support Python 3.10 #863

Moisan opened this issue Oct 22, 2021 · 13 comments
Assignees
Milestone

Comments

@Moisan
Copy link

Moisan commented Oct 22, 2021

Is your feature request related to a problem? Please describe. For generic questions use Q&A section in the Discussions forum above.

pyyaml is currently at version 3.10 while the latest is currently 6.0. Python 3.10 includes the deprecation of classes that are generic within collections. Currently, running Spades with Python 3.10 leads to the error

AttributeError: module 'collections' has no attribute 'Hashable'

Describe the solution you'd like

The issue has been fixed in 2019 in pyyaml so the fix would simply be to upgrade it.

Describe alternatives you've considered

You could always change the readme to state that Spades doesn't support Python >= 3.10.

Additional context

No response

@asl
Copy link
Member

asl commented Oct 22, 2021

Thanks for letting us know! We will consider integrating the fix in the next SPAdes versions.

@SchwarzEM
Copy link

I just came across this bug report. Thanks to @Moisan and @SilasK for posting about it, because it allowed me to fix what had been a complete show-stopper problem. I fixed it by setting up a python_3.9 environment in conda and then running the precompiled Linux binaries within that activated environment. Normally I use bioconda to install software; the current bioconda package for the most recent versions of SPAdes have python 3.10 associated with them, and so cannot be run. When it is possible, I hope pyyaml can be updated in both the free-standing and bioconda-provided versions of SPAdes.

@asl
Copy link
Member

asl commented Nov 22, 2021

The fix is planned for SPAdes 3.15.4.

@nvpatin
Copy link

nvpatin commented Dec 9, 2021

Hi all, I have the same problem. I've read through the solutions and not sure why it is still an issue for me. I installed SPAdes-3.15.3-Linux in a conda environment with Python 3.9 (although I did NOT install SPAdes with conda). I also updated pyyaml. It still fails with the AttributeError: module 'collections' has no attribute 'Hashable.' When I check the error log, it shows the following:

Command line: /home/nvp29/miniconda3/envs/spades/bin/spades.py -1 /work/hpc/users/nvp29/eCruises_2019/Illumina_reads_matching/1903c111_10m$

System information:
SPAdes version: 3.13.0
Python version: 3.10.0
OS: Linux-3.10.0-957.27.2.el7.x86_64-x86_64-with-glibc2.17

Output dir: /work/hpc/users/nvp29/eCruises_2019/hybridSPAdes/1903c111_10m-1
Mode: read error correction and assembling
Debug mode is turned OFF

Dataset parameters:
Metagenomic mode
Reads:

Why would it show Python v3.10 when the conda environment was set up with Python 3.9?

@asl
Copy link
Member

asl commented Dec 9, 2021

Why would it show Python v3.10 when the conda environment was set up with Python 3.9?

I think you'd need to check your environment, why the "outer" python is leaking into the conda. Also your SPAdes is utterly old.

@nick-youngblut
Copy link

nick-youngblut commented Jan 27, 2022

the current bioconda package for the most recent versions of SPAdes have python 3.10 associated with them

Anyone planning on fixing the bioconda recipe, given this bug? Currently, the recipe requires python >=3.10

Maybe @rpetit3? ... given the recent work on the recipe, eg., bioconda/bioconda-recipes#30759

@asl
Copy link
Member

asl commented Jan 27, 2022

@nick-youngblut This question is likely to be asked at Unicycler, no? We are not affiliated with them in any way.

SPAdes release with the fix is scheduled next week.

@asl
Copy link
Member

asl commented Feb 9, 2022

@MaryoHg
Copy link

MaryoHg commented Apr 13, 2023

Thanks @SchwarzEM

I just came across this bug report. Thanks to @Moisan and @SilasK for posting about it, because it allowed me to fix what had been a complete show-stopper problem. I fixed it by setting up a python_3.9 environment in conda and then running the precompiled Linux binaries within that activated environment. Normally I use bioconda to install software; the current bioconda package for the most recent versions of SPAdes have python 3.10 associated with them, and so cannot be run. When it is possible, I hope pyyaml can be updated in both the free-standing and bioconda-provided versions of SPAdes.

This worked charmly for me. At least, the code is running. We'll check the output later.

The steps were as follows (for anyone out there who needs this)

  • Create a conda environment with Pyhton 3.9
    $ conda create -n spadesenv python=3.9
    $ conda activate spadesenv

  • Install the binary for Linux (see here)
    $ wget http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5-Linux.tar.gz
    $ tar -xzf SPAdes-3.15.5-Linux.tar.gz
    $ cd SPAdes-3.15.5-Linux/bin/

  • Run the command
    $ metaspades.py -1 file_R1.fastq.gz -2 file_R2.fastq.gz --threads 24 -o outdir/

@asl
Copy link
Member

asl commented Apr 13, 2023

@MaryoHg You do not need this. SPAdes 3.15.4 and later is Python 3.10 compatible

@MaryoHg
Copy link

MaryoHg commented Apr 13, 2023

Dear @asl ,

Thanks for the comment. However, I downloaded the binary ($ wget http://cab.spbu.ru/files/release3.15.5/SPAdes-3.15.5-Linux.tar.gz) and I got the same issue:

AttributeError: module 'collections' has no attribute 'Hashable'.

I couldn't install with conda (conda install -c bioconda spades=3.15.5) due an older version of gblic on the server I'm working on.

Any idea or advise?

Saludos.

@asl
Copy link
Member

asl commented Apr 13, 2023

AttributeError: module 'collections' has no attribute 'Hashable'.

Likely you ended with weird mixture of files from different version of SPAdes: one installed somehow "globally" and another one – from binary build. We just double checked and 3.15.5 is clearly compatible with Python 3.10

@MaryoHg
Copy link

MaryoHg commented Apr 20, 2023

AttributeError: module 'collections' has no attribute 'Hashable'.

Likely you ended with weird mixture of files from different version of SPAdes: one installed somehow "globally" and another one – from binary build. We just double checked and 3.15.5 is clearly compatible with Python 3.10

Thanks, @asl

I'll cleaned everything and started over: it now is running. Thanks!

Saludos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants