Nextstrain Installation

Hi Nextstrain Team,

I have been running workflows using the Nextstrain CLI for the last 3 months.

However, today I tried to run a workflow but keep getting this error:

Traceback (most recent call last):
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/snakemake/__init__.py", line 792, in snakemake
    success = workflow.execute(
              ^^^^^^^^^^^^^^^^^
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/snakemake/workflow.py", line 1246, in execute
    raise e
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/snakemake/workflow.py", line 1242, in execute
    success = self.scheduler.schedule()
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/snakemake/scheduler.py", line 617, in schedule
    run = self.job_selector(needrun)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/snakemake/scheduler.py", line 758, in job_selector_ilp
    from stopit import ThreadingTimeout as Timeout, TimeoutException
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/stopit/__init__.py", line 10, in <module>
    import pkg_resources
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/pkg_resources/__init__.py", line 95, in <module>
    from jaraco.text import drop_comment, join_continuation, yield_lines
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/setuptools/_vendor/jaraco/text/__init__.py", line 12, in <module>
    from jaraco.context import ExceptionTrap
  File "/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/setuptools/_vendor/jaraco/context.py", line 17, in <module>
    from backports import tarfile
ImportError: cannot import name 'tarfile' from 'backports' (/Users/nikitasitharam/.nextstrain/runtimes/conda/env/lib/python3.11/site-packages/backports/__init__.py)

Steps I have done so far and still receiving the same error:

  • Deleted the conda environment giving me this issue
  • Installed Nextstrain CLI in a new conda env using bioconda
  • I have the Nextstrain CLI installed on another machine with the same operating system and it works there. I copied the specs and tried to set up a new conda env using those specs.
  • Here is the spec file of the conda env that is working on another OS machine spec-file.txt (13.4 KB)

I am not sure if I am missing something.

Hi @NikitaSitharam, we’ve run into this issue at least once before and the best workaround seemed to be running nextstrain setup conda --force on the computer where you’ve experienced the error. This command tells the Nextstrain CLI to delete its managed Conda environment and reinstall from scratch which should have a similar effect as the fresh installation you made on your other computer. With this approach, you don’t have to delete any Conda environments manually yourself or manage Conda env specs, so it should hopefully be a simpler process.

If you run that command above, does it fix the issue for you?

@NikitaSitharam Before trying @jlhudd’s suggestion (which I second), could you first run

nextstrain version --verbose

on the machine that doesn’t work and copy its full output to us here? It would help us understand the issue.

@jlhudd Okay perfect, thank you so much! I will give this a try.

@trs I ran the command you sent through. This was the full output:

nextstrain.cli 8.5.3

Python
/Users/nikitasitharam/.nextstrain/cli-standalone/nextstrain
3.10.9 (main, Dec 21 2022, 05:06:54) [Clang 14.0.3 ]

Runners
docker
unknown

conda (default)

The output seems to be truncated. I just ran it and noticed that it it can take a few minutes before anything is printed after the line conda (default). Can you re-run and check if anything else is shown?

Here is mine for reference:

nextstrain.cli 8.5.1

Python
  /Users/victor/.nextstrain/cli-standalone/nextstrain
  3.10.9 (main, Dec 20 2022, 19:01:09) [Clang 14.0.3 ]

Runners
  docker 
Cannot connect to the Docker daemon at unix:///Users/victor/.docker/run/docker.sock. Is the docker daemon running?
    unknown

  conda (default)
env: node: No such file or directory
    nextstrain-base 20240822T214654Z (h0dc7051_0_locked, nextstrain)
    augur 25.3.0

  singularity 
    docker://nextstrain/base (not present)

  ambient 
    unknown

  aws-batch 
    unknown

Ah I see, apologies for that. Here is the full output:

  /Users/nikitasitharam/.nextstrain/cli-standalone/nextstrain
  3.10.9 (main, Dec 21 2022, 05:06:54) [Clang 14.0.3 ]

Runners
  docker 
    unknown

  conda (default)
env: node: No such file or directory
    nextstrain-base 20241010T175750Z (h0dc7051_0_locked, nextstrain)
    augur 26.0.0

  singularity 
    docker://nextstrain/base (not present)

  ambient 
    unknown

  aws-batch 
    unknown

It looks like you have the latest version of the conda runtime, 20241010T175750Z. Did you already apply the fix of nextstrain setup conda --force? If so, are you still seeing the workflow execution error from your first post?

Yes, I have run nextstrain setup conda --force and it has solved the error.

Thank you!

Great, glad to hear! We suspect the issue is specific to at least one of the older runtime versions.