showyourwork.cli.conda_env.run_in_env(command, **kwargs)#

Run a command in the isolated showyourwork conda environment.

This function creates and activates an isolated conda environment and executes command in it, with optional kwargs passed to The conda environment is specified in showyourwork/workflow/envs/environment.yml and consists primarily of the dependencies needed to execute Snakemake, including mamba. To this environment we add the specific version of showyourwork requested in the article repository’s showyourwork.yml file.

Note that this ensures that the article is built with the version of showyourwork specified by the workflow, and not the version the user currently has installed.

To speed things up on future runs, we cache the environment in the temporary folder ~/.showyourwork/env.

  • command (str) – The command to run.

  • kwargs – Keyword arguments to pass to


The result of the command.

Return type


  • exceptions.CondaNotFoundError – If conda is not found.

  • exceptions.ShowyourworkException – If the cwd is not the top level of a showyourwork project.

  • exceptions.ShowyourworkNotFoundError – If the requested version of showyourwork in the config file cannot be found.