# AttributeError: module 'asyncio' has no attribute 'create\_task'

**URL:** <https://nextstrain.discourse.group/t/attributeerror-module-asyncio-has-no-attribute-create-task/187>\
**Category:** Help and Getting Started\
**Created:** [November 8, 2020, 1:07pm UTC](https://nextstrain.discourse.group/t/attributeerror-module-asyncio-has-no-attribute-create-task/187 "2020-11-08T13:07:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![limwaifeng85](https://avatars.discourse-cdn.com/v4/letter/l/c4cdca/32.png) [@limwaifeng85](https://nextstrain.discourse.group/u/limwaifeng85)\
**Post date:** [November 8, 2020, 1:07pm UTC](https://nextstrain.discourse.group/t/attributeerror-module-asyncio-has-no-attribute-create-task/187/1 "2020-11-08T13:07:46Z")

</div>

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](https://github.com/nextstrain/ncov.git)

2. Setup environment - OKAY  
curl [http://data.nextstrain.org/nextstrain.yml](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

---

<div class="post-metadata">

**Author:** ![jlhudd](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/jlhudd/32/583_2.png) [@jlhudd](https://nextstrain.discourse.group/u/jlhudd)\
**Post date:** [November 9, 2020, 10:26pm UTC](https://nextstrain.discourse.group/t/attributeerror-module-asyncio-has-no-attribute-create-task/187/2 "2020-11-09T22:26:15Z")

</div>

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](https://github.com/nextstrain/conda/pull/10) 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?

---

<div class="post-metadata">

**Author:** ![limwaifeng85](https://avatars.discourse-cdn.com/v4/letter/l/c4cdca/32.png) [@limwaifeng85](https://nextstrain.discourse.group/u/limwaifeng85)\
**Post date:** [November 10, 2020, 12:58am UTC](https://nextstrain.discourse.group/t/attributeerror-module-asyncio-has-no-attribute-create-task/187/3 "2020-11-10T00:58:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jlhudd](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/jlhudd/32/583_2.png) [@jlhudd](https://nextstrain.discourse.group/u/jlhudd)\
**Post date:** [November 10, 2020, 5:17pm UTC](https://nextstrain.discourse.group/t/attributeerror-module-asyncio-has-no-attribute-create-task/187/4 "2020-11-10T17:17:40Z")

</div>

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

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

```
