module 'asyncio' has no attribute 'coroutine' on snakemake

Question:

I followed the following code to install snakemake on my linux machine :

conda activate base
mamba create -c conda-forge -c bioconda -n snakemake snakemake
conda activate snakemake

Everything was fine, but when I try to run the following code :

snakemake -s Snakemake_job -j n

I get this error :

Building DAG of jobs...
Traceback (most recent call last):
  File "/home/debian/.conda/envs/snakemake/lib/python3.11/site-packages/snakemake/__init__.py", line 747, in snakemake
    success = workflow.execute(
              ^^^^^^^^^^^^^^^^^
  File "/home/debian/.conda/envs/snakemake/lib/python3.11/site-packages/snakemake/workflow.py", line 949, in execute
    self.scheduler = JobScheduler(
                     ^^^^^^^^^^^^^
  File "/home/debian/.conda/envs/snakemake/lib/python3.11/site-packages/snakemake/scheduler.py", line 109, in __init__
    from ratelimiter import RateLimiter
  File "/home/debian/.conda/envs/snakemake/lib/python3.11/site-packages/ratelimiter.py", line 36, in <module>
    class RateLimiter(object):
  File "/home/debian/.conda/envs/snakemake/lib/python3.11/site-packages/ratelimiter.py", line 127, in RateLimiter
    __aexit__ = asyncio.coroutine(__exit__)
                ^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

Does someone have an idea of what is going on? I tried to re-install snakemake, or to pip install asyncio without sucess…

Asked By: chippycentra

||

Answers:

Quoth the docs for asyncio.coroutine, emphasis mine:

Deprecated since version 3.8, will be removed in version 3.11: Use async def instead.

The ratelimiter dependency snakemake uses is evidently not compatible with Python 3.11.

That package has had an issue open about this for multiple years, and snakemake seems to be switching dependencies.

In other words, your choices are:

Answered By: AKX
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.