AttributeError: module 'asyncio' has no attribute 'create_task'

Dear all,

Greeting. I would like to use nextrain to construct phylogenetiioc tree.

Firstly, I followed Tutorial using for SARS-CoV-2 to install in my MacOS High Sierra version 10.13.6.

  1. Make a copy of tutorial - OKAY
    git clone https://github.com/nextstrain/ncov.git

  2. Setup environment - OKAY
    curl http://data.nextstrain.org/nextstrain.yml --compressed -o nextstrain.yml
    conda env create -f nextstrain.yml
    conda activate nextstrain
    npm install --global auspice

  3. Run a basic analysis with example data
    cd ncov - okay
    gzip -d -c data/example_sequences.fasta.gz > data/example_sequences.fasta - okay

snakemake --cores 4 --profile ./my_profiles/getting_started

  • AttributeError: module ‘asyncio’ has no attribute ‘create_task’
  • May I know how to solve it?

I’m new in bioinformatic, if any particular information needed please guide me. Appreciate and thanks.

Take care and stay safe.

Best wishes,
Wai Feng

Hi @limwaifeng85, thank you for reporting this issue. This is an error related to recent versions of Snakemake. I just updated our conda environment file to use a specific earlier version of Snakemake that should not have this issue.

Would you mind installing the Nextstrain environment again from scratch (after running conda env remove -n nextstrain and letting us know whether the issue is fixed for you now?

Hi, thanks for your reply.

I have removed the earlier version and reinstalled as per guidelines.

Right now, another error pop out. Appreciate if you can help further, thanks.

(nextstrain) Lims-MacBook-Air:ncov limwaifeng$ snakemake --cores 4 --profile ./my_profiles/getting_started

Building DAG of jobs…
Using shell: /bin/bash
Provided cores: 4
Rules claiming more threads will be scaled down.
Conda environments: ignored
Job counts:
count jobs
1 aggregate_alignments
1 all
1 ancestral
1 clades
1 colors
1 combine_samples
1 diagnostic
1 export
1 filter
1 finalize
1 incorporate_travel_history
1 legacy_clades
1 mask
1 partition_sequences
1 recency
1 refilter
1 refine
1 rename_legacy_clades
1 rename_subclades
1 subclades
1 subsample
1 tip_frequencies
1 traits
1 translate
1 tree
25

[Tue Nov 10 08:54:37 2020]
Job 5: Constructing colors file

    python3 scripts/assign-colors.py             --ordering defaults/color_ordering.tsv             --color-schemes defaults/color_schemes.tsv             --output results/global/colors.tsv             --metadata data/example_metadata.tsv 2>&1 | tee logs/colors_global.txt

[Tue Nov 10 08:54:37 2020]
Job 25:
Filtering to
- excluding strains in defaults/exclude.txt

    augur filter             --sequences data/example_sequences.fasta             --metadata data/example_metadata.tsv             --include defaults/include.txt             --max-date 2020-11-10             --min-date 2019.74             --exclude defaults/exclude.txt             --exclude-where division='USA' date='2020' date='2020-01-XX' date='2020-02-XX' date='2020-03-XX' date='2020-04-XX' date='2020-05-XX' date='2020-06-XX' date='2020-07-XX' date='2020-08-XX' date='2020-09-XX' date='2020-10-XX' date='2020-11-XX' date='2020-12-XX' date='2020-01' date='2020-02' date='2020-03' date='2020-04' date='2020-05' date='2020-06' date='2020-07' date='2020-08' date='2020-09' date='2020-10' date='2020-11' date='2020-12'            --min-length 27000             --output results/filtered.fasta 2>&1 | tee logs/filtered.txt

[Tue Nov 10 08:54:37 2020]
Job 13: Use metadata on submission date to construct submission recency field

    python3 scripts/construct-recency-from-submission-date.py             --metadata data/example_metadata.tsv             --output results/global/recency.json 2>&1 | tee logs/recency_global.txt

Traceback (most recent call last):
File “/Users/limwaifeng/ncov/scripts/construct-recency-from-submission-date.py”, line 3, in
from augur.utils import read_metadata
ModuleNotFoundError: No module named ‘augur’
[Tue Nov 10 08:54:38 2020]
Error in rule recency:
jobid: 13
output: results/global/recency.json
log: logs/recency_global.txt (check log file(s) for error message)
shell:

    python3 scripts/construct-recency-from-submission-date.py             --metadata data/example_metadata.tsv             --output results/global/recency.json 2>&1 | tee logs/recency_global.txt
    
    (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

[Tue Nov 10 08:54:41 2020]
Finished job 5.
1 of 25 steps (4%) done

44 sequences were dropped during filtering
7 of these were dropped because they were in defaults/exclude.txt
38 of these were dropped because of ‘division=USA’
0 of these were dropped because of ‘date=2020’
0 of these were dropped because of ‘date=2020-01-XX’
0 of these were dropped because of ‘date=2020-02-XX’
0 of these were dropped because of ‘date=2020-03-XX’
0 of these were dropped because of ‘date=2020-04-XX’
0 of these were dropped because of ‘date=2020-05-XX’
0 of these were dropped because of ‘date=2020-06-XX’
0 of these were dropped because of ‘date=2020-07-XX’
0 of these were dropped because of ‘date=2020-08-XX’
0 of these were dropped because of ‘date=2020-09-XX’
0 of these were dropped because of ‘date=2020-10-XX’
0 of these were dropped because of ‘date=2020-11-XX’
0 of these were dropped because of ‘date=2020-12-XX’
0 of these were dropped because of ‘date=2020-01’
0 of these were dropped because of ‘date=2020-02’
0 of these were dropped because of ‘date=2020-03’
0 of these were dropped because of ‘date=2020-04’
0 of these were dropped because of ‘date=2020-05’
0 of these were dropped because of ‘date=2020-06’
0 of these were dropped because of ‘date=2020-07’
0 of these were dropped because of ‘date=2020-08’
0 of these were dropped because of ‘date=2020-09’
0 of these were dropped because of ‘date=2020-10’
0 of these were dropped because of ‘date=2020-11’
0 of these were dropped because of ‘date=2020-12’
0 of these were dropped because they were shorter than minimum length of 27000bp
0 of these were dropped because of their date (or lack of date)

1 sequences were added back because they were in defaults/include.txt

374 sequences have been written out to results/filtered.fasta
[Tue Nov 10 08:54:44 2020]
Finished job 25.
2 of 25 steps (8%) done
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /Users/limwaifeng/ncov/.snakemake/log/2020-11-10T085437.265937.snakemake.log

That is progress! :slight_smile: Can you try running the workflow like this instead, @limwaifeng85?

snakemake --use-conda --cores 4 --profile ./my_profiles/getting_started