Installation
These instructions set out how to obtain and install the software on Linux. It is assumed that you have access to a terminal/shell on a reasonably modern Linux or macOS system. If you are using Windows, please refer to the section below.
Snakemake is available through pixi, conda, or pip, and packaged for several linux distributions. Alternatively, you can also build it from source.
Install via Pixi
This is the recommended way to install Snakemake. To install Pixi on your system, please follow the Pixi installation instructions.
If you wish to install Snakemake globally on your system, run:
$ pixi global install snakemake conda -c conda-forge -c bioconda
You do not need root/administrator access for this.
Here, the conda installation ensures that conda is available for the management of any rule-specific software installations specified via the conda directive. If you deploy software via a different mechanism, you can omit conda from the installation.
You can also keep the installation contained in a directory-specific pixi environment. In the directory where you want to install Snakemake, run:
$ pixi init
$ pixi workspace channel add conda-forge
$ pixi workspace channel add bioconda
$ pixi add snakemake
If you want to use conda for your rule-specific software deployment, also install it:
$ pixi add conda
You can then activate the environment in the directory where you created it by running:
$ pixi shell
Install via Conda/Mamba
Conda is a language-agnostic package and environment manager.
There are many different ways to install conda; we recommend Miniforge.
Of course, any other conda-based package manager can be used as well, e.g. Pixi, Mamba or Micromamba. Note however that for the conda integration of Snakemake, the conda command is currently required to be installed in the root environment or in the same environment as Snakemake itself.
Full Installation
Snakemake can be installed with all the goodies needed to run in any environment and for creating interactive reports via
$ conda create -c conda-forge -c bioconda -c nodefaults -n snakemake snakemake
from the Bioconda channel. This will install Snakemake into an isolated software environment, that has to be activated with
$ conda activate snakemake
$ snakemake --help
Installing into isolated environments is best practice in order to avoid side effects with other packages.
Minimal Installation
A minimal version with only the necessary requirements can be installed with
$ conda create -c conda-forge -c bioconda -c nodefaults -n snakemake snakemake-minimal
Notes on Bioconda as a Package Source
Snakemake is available via Bioconda for historical, reproducibility, and continuity reasons (although it is not limited to biology applications at all).
However, it is easy to combine Snakemake installation with other channels, e.g., by prefixing the package name with ::bioconda, i.e.,
$ conda activate base
$ conda create -n some-env -c conda-forge -c nodefaults bioconda::snakemake ...
Install via Pip
pip is the default package manager in python.
You can install Snakemake via pip with:
$ pip install snakemake
System installation
If you have root/administrator access, you can install Snakemake through your linux distributions’ official package manager:
$ sudo apt-get update
$ sudo apt-get install snakemake
$ sudo yum install snakemake
Please note that these packages are not maintained by the snakemake organization, and may still be on older versions of Snakemake.
Install a Development Version
If you want to quickly try out an unreleased version from the Snakemake repository, e.g. to check whether a bug fix works for your workflow, you can get the current state of the main branch with:
$ conda create --only-deps -n snakemake-dev -c conda-forge -c bioconda -c nodefaults snakemake
$ conda activate snakemake-dev
$ pip install git+https://github.com/snakemake/snakemake
You can also install the current state of another branch or the repository state at a particular commit. For information on the syntax for this, see the pip documentation on git support.
Alternatively, you can also check out the repository with git and install a dev environment with pixi. For detailed instructions, see Testing Guide using pixi.
Editor Integrations
There are a number of integrations with popular editors that offer convenient features such as syntax highlighting and formatting:
Setup on Windows
If you use Windows 10, you can set up the Windows Subsystem for Linux (WSL) to natively run linux applications. Install the WSL following the instructions in the WSL Documentation. You can chose any Linux distribution available for the WSL, but the most popular and accessible one is Ubuntu. Start WSL and set up your account; then, you can use one of the methods above to install Snakemake within your WSL Linux environment.