Installing Unsloth on Windows
See how to install Unsloth on Windows with or without WSL.
Method #1 - Docker:
1
export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
sudo apt-get update && sudo apt-get install -y \
nvidia-container-toolkit=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}2
docker run -d -e JUPYTER_PASSWORD="mypassword" \
-p 8888:8888 -p 2222:22 \
-v $(pwd)/work:/workspace/work \
--gpus all \
unsloth/unsloth3
4
5
Method #2 - WSL:
1
wsl.exe --install Ubuntu-24.04
wsl.exe -d Ubuntu-24.042
wsl3
sudo apt update
sudo apt install python3 python3-full python3-pip python3-venv -y4
pip install torch torchvision --force-reinstall --index-url https://download.pytorch.org/whl/cu1305
pip install unsloth jupyter6
jupyter notebookMethod #3 - Windows directly:
1
2
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" modify ^
--installPath "C:\Program Files\Microsoft Visual Studio\2022\Community" ^
--add Microsoft.Net.Component.4.8.SDK ^
--add Microsoft.Net.Component.4.7.2.TargetingPack ^
--add Microsoft.VisualStudio.Component.Roslyn.Compiler ^
--add Microsoft.Component.MSBuild ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
--add Microsoft.VisualStudio.Component.VC.Redist.14.Latest ^
--add Microsoft.VisualStudio.Component.VC.CMake.Project ^
--add Microsoft.VisualStudio.Component.VC.CLI.Support ^
--add Microsoft.VisualStudio.Component.VC.Llvm.Clang ^
--add Microsoft.VisualStudio.ComponentGroup.ClangCL ^
--add Microsoft.VisualStudio.Component.Windows11SDK.22621 ^
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 ^
--add Microsoft.VisualStudio.Component.UniversalCRT.SDK ^
--add Microsoft.VisualStudio.Component.VC.Redist.MSM3
4
5
pip install "unsloth[windows] @ git+https://github.com/unslothai/unsloth.git"Notes
Advanced/Troubleshooting
Method #3 - Windows using PowerShell:
Step 1: Install Prerequisites
Step 2: Run the Unsloth Installation Script
Step 3: Using Unsloth
Last updated
Was this helpful?


