Here I’d like to walk through how to install SLEAP, a machine learning-based tool for tracking animal body parts.
DeepLabCut is the best-known tracking tool, and I’ve written about how to install it myself in the past, while many others have posted articles about it as well.
SLEAP, however, has relatively few articles written about it in Japanese.
SLEAP has many advantages over DeepLabCut, so I decided to write up the installation procedure to make it a viable option for more people.
SLEAP’s documentation covers everything from installation to usage very clearly, complete with videos, so anyone comfortable with English should find it easy to get started.
The SLEAP paper is available here
The official SLEAP website is here
The SLEAP GitHub repository is here
Introduction
First, a note about the approach described in the official SLEAP installation guide:
mamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.3
the one-line command that is supposed to handle environment creation, package installation, and everything else at once. I tried it on several computers, but in every case it hung indefinitely during the environment creation step and never completed.
So in this post I’ll introduce the alternative installation method that the developers also suggest.
Installation
We’ll basically follow the installation instructions on the official SLEAP site.
Environment
・Windows 11 Pro
・Verified on an NVIDIA 3080
・SLEAP 1.3.3
・Python 3.7.12
Downloading the files
First, download the files from the SLEAP GitHub repository to your computer.
If you’re using Git, run the following command.
git clone https://github.com/talmolab/sleap
If the git command isn’t available, either install git or download the files directly from GitHub.

Installing the GPU driver
Install the NVIDIA driver.
(Skip this step if it’s already installed.)
Installing Anaconda
Next, download and install the Windows 10 64-bit version from the Anaconda website.
Click Free Download on the Anaconda site and scroll down; you’ll see a screen like the one below.
Install the Windows installer on the far left.

Once Anaconda is installed, you should find “Anaconda Prompt” in your Windows app list.
We’ll use it to run the commands below to create the virtual environment, install the packages, and finally launch SLEAP.
Creating the virtual environment and installing
Next, run the following commands to create the virtual environment and install SLEAP.
The environment will be named “sleap”.
cd sleap
conda env create -f environment.yml -n sleap
Incidentally, the commands above work on computers with a GPU;
on machines without one, use the following instead.
cd sleap
conda env create -f environment_no_cuda.yml -n sleap
That completes the installation.
Checking that the installation worked
Activate the virtual environment and launch SLEAP with sleap-label.
conda activate sleap
sleap-label
You’ll need to activate the virtual environment (the conda activate sleap command) every time you reopen Anaconda Prompt.
After activating the environment, the prompt should change from (base) to (sleap).
If it launches, the installation was successful.
Checking version information for reporting in a paper
To check the version, activate the sleap environment and then run the following command.
python -c "import sleap; sleap.versions()"
This outputs:
SLEAP: 1.3.3
TensorFlow: 2.7.0
Numpy: 1.21.5
Python: 3.7.12
OS: Windows-10-10.0.22621-SP0
which shows the SLEAP version and related information.
To check whether SLEAP can use the GPU, run:
python -c "import sleap; sleap.system_summary()"
If the GPU is available, you’ll see output like the following.
GPUs: 1/1 available
Device: /physical_device:GPU:0
Available: True
Initialized: False
Memory growth: None
In future posts, I hope to walk through how to actually use SLEAP.
Bonus
For those who aren’t sure which computer to buy, I’ve started offering PC purchase consultations on Coconala!
あなたの要望に合わせてパソコンを選び、提案します パソコン選びに困っている方々へ!様々な目的に対応できます!I often pick out computers and give advice about them, and many friends have told me I could make money doing PC consultations.
That inspired me to give it a try!
I’ll recommend a machine that fits both what you want to use it for and your budget.
In particular, I’ve chosen and used many computers intended for machine learning.
And if you’d like, I can also advise you on what to look for the next time you buy a computer.
Computers I’ve picked out so far include lab analysis machines, everyday-use machines, game streaming machines, machines for incoming university students, machines that can run CAD for architecture students, and simple entry-level machines.
I use both Mac and Windows, so I can discuss and recommend either one!
Please feel free to make use of it.
![How to Install SLEAP [Updated February 2024]](https://www.stg.tankobucreate.com/wp-content/uploads/2024/01/スクリーンショット-2024-01-21-21.14.17.png)

![How to Install DeepLabCut 2.3 [Updated December 2023]](https://www.stg.tankobucreate.com/wp-content/uploads/2021/03/DLC_logo_blk_wide-01.png)






