Repository navigation
Closed
Labels
insufficient informationWhen the Issue author does not provide enough information about setup, issue or help us debug
Description
⚡wo ❯❯ irm https://unsloth.ai/install.ps1 | iex
🦥 Unsloth Studio Installer (Windows)
────────────────────────────────────────────────────
python Python 3.12 already installed
removing existing environment for fresh install...
venv creating Python 3.12 virtual environment
C:\Users\wo\.unsloth\studio\unsloth_studio
gpu NVIDIA GPU detected
installing PyTorch (https://download.pytorch.org/whl/cu130)...
installing unsloth (this may take a few minutes)...
setup running unsloth studio setup...
Note: 'unsloth studio setup' is deprecated. Use 'unsloth studio update' or re-run install.sh.
🦥 Unsloth Studio Setup
────────────────────────────────────────────────────
gpu NVIDIA GPU detected
[OK] Windows Long Paths enabled
git git version 2.49.0.windows.1
cmake cmake version 4.3.1
vs Visual Studio 17 2022 (filesystem (BuildTools))
cl.exe: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe
Driver supports up to CUDA 13.2
GPU Compute Capability = 8.9 (sm_89)
[OK] Using existing CUDA Toolkit at CUDA_PATH (nvcc: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1\bin\nvcc.exe)
Persisted CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1 to user environment
Set CUDA_PATH_V13_1 (cleared other CUDA_PATH_V* vars)
cuda C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1\bin\nvcc.exe
CUDA_PATH = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1
CudaToolkitDir = C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.1\
[OK] Node v25.8.0 and npm 11.11.1 already meet requirements.
node v25.8.0 | npm 11.11.1
[OK] bun already installed (1.3.5)
--- System prerequisites ready ---
frontend up to date
Installing OXC validator runtime...
[OK] OXC validator runtime installed
Setting up Python environment...
[OK] Using D:\scoop\Scoop\shims\python3.exe (Python 3.12.10)
[INFO] Stale venv detected (torch cpu != required cu130) -- rebuilding...
[ERROR] Could not remove stale venv: 对路径“python.exe”的访问被拒绝。
Close any running Studio/Python processes and re-run setup.
[ERROR] unsloth studio setup failed (exit code 1)Reacted by Quyen
Metadata
Metadata
Assignees
Labels
insufficient informationWhen the Issue author does not provide enough information about setup, issue or help us debug
Activity
rolandtannous commentedon Mar 30, 2026
did you check if you had running python processes that are file locked?
could you also please explain your setup. thank you
fix: robust venv removal on Windows (issue unslothai#4701)
htw2ai commentedon Apr 1, 2026
Remove the PYTHONPATH environment variable
JackieJK commentedon Apr 1, 2026
是的,我检查过没有python进程,也没有其他进程会锁定我的python相关文件。
我的环境是windows 11 + scoop + python3.12
Yes, I checked and there are no Python processes, nor any other processes that would lock my Python-related files.
My environment is Windows 11 + Scoop + Python 3.12.
JackieJK commentedon Apr 1, 2026
I don't understand what you mean? I installed Python via scoop install python312 && scoop reset python312
JyothishArumugam commentedon Apr 6, 2026
Root Cause Found + Full Workaround
I hit the exact same error on Windows 11 with Python 3.13.5 and CUDA 12.4.
After extensive debugging, I identified four distinct bugs causing this failure.
Root Cause 1:
uvstrips the CUDA suffix from torch when resolving unslothThe installer installs
torch+cu124in phase 1, but whenunslothis resolvedin the same
uv pip installcall, uv's solver replaces it withtorch==2.10.0(CPU-only, no CUDA suffix). This is why setup.ps1 always sees "torch cpu"
regardless of GPU.
Fix: Install torch and unsloth in separate
uv pip installcalls,and pin torch before installing unsloth.
Root Cause 2:
Remove-Itemfails on Windows due to file handle locking on.exefilessetup.ps1uses PowerShell'sRemove-Itemto delete the stale venv. On Windows,.exefiles inside a freshly created venv retain residual handles even after thecreating process exits.
Remove-Itemfails with "Access Denied" whilecmd /c rd /s /qworks reliably.Fix: Replace
Remove-Item -Recurse -Force $VenvDirin setup.ps1 with:Root Cause 3: xformers has no Python 3.13 wheels, making unsloth unsatisfiable
The installer auto-installs Python 3.13 but xformers only has wheels up to cp312:
Fix: Use
--no-depsfor unsloth on Python 3.13, or pin Python 3.12 in the installer.Root Cause 4: no-deps skips installation we would be left with packages missing.
After manually fixing the venv, launching
unsloth studiocrashes with missing modules:structlogdicewarematplotlibnest_asyncioPyJWT(wrong packagejwtis installed — it has no.encode()attribute)Working Workaround
Also a complete solution adhering the code structure is submitted in the PR (#4877)
This also affects users with Scoop Python, PyManager, and likely any
non-standard Python manager — the common thread is
uvstripping the CUDAtorch build and
Remove-Itemfailing on Windows file locks.Verified working on: Windows 11, Python 3.13.5, CUDA 12.4, RTX 3060 Laptop GPU.
rolandtannous commentedon Apr 6, 2026
@JyothishArumugam this diagnosis is not accurate. The issue here is only scoop specific. Where no scoop is used, it's confirmed to work on windows via user testing and internal testing. Your specific issue is different . i think its a cuda mismatch on windows that a lot of users on windows had and we fixed as follows: You need to make sure that the cuda version shown by
nvcc --versionmatches the CUDA version shown bynvidia-smion windows.changing the way we install the package in the manner done in your fix will actually break the package. The install sequence, flags used, are intentional.
JyothishArumugam commentedon Apr 6, 2026
@rolandtannous I've verified my environment (screenshot attached), and both nvcc and nvidia-smi are aligned on CUDA 12.4. The issue I'm seeing isn't a version mismatch, but the uv resolver stripping the +cu124 suffix during the main install, which leads to the venv-rebuild loop. How can we ensure the CUDA suffix is preserved while staying within the intentional install sequence?
rolandtannous commentedon Apr 6, 2026
@JyothishArumugam ping me on our discord server https://discord.com/invite/unsloth on the help channel and we'll troubleshoot it more thoroughly for your case. My username there is Roland
zhengyuxi1 commentedon Apr 9, 2026
我遇到和楼主一样的问题,使用以下步骤成功安装了
qwertie commentedon Apr 30, 2026
@rolandtannous I have the same error (after removing C:\Python314 from PATH, whose presence also prevented installation, and restarting my PC):
You suggested comparing versions? They are both 12.0 for me:
huainian6911 commentedon Jun 30, 2026
I have a same error with uv:
pip: declare the Studio dependencies the wheel's own modules import (#…
Studio: detect an interrupted dependency install instead of launching…