Skip to content

[Bug] Install issue on Windows 11 #7147

Closed

Description

@ArnaudContet

Trying to do a fresh install of Unsloth Studio today on my Win11 laptop with the script from the website. Read elsewhere that some versions of Python could be conflictual, so I unsinstalled them all, to let the script pull the one it wants.

PS C:\> irm https://unsloth.ai/install.ps1 | iex

  🦥 Unsloth Studio Installer (Windows)
  ────────────────────────────────────────────────────

  winget         available
                 installing Python 3.13...
Found Python 3.13 [Python.Python.3.13] Version 3.13.14
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://www.python.org/ftp/python/3.13.14/python-3.13.14-amd64.exe
  ██████████████████████████████  27.8 MB / 27.8 MB
Successfully verified installer hash
Starting package install...
Successfully installed
  venv           creating Python 3.13 virtual environment
                 C:\Users\xxxx\.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...
Invoke-Expression: Program 'unsloth.exe' failed to run: An error occurred trying to start process 'C:\Users\xxxx\.unsloth\studio\unsloth_studio\Scripts\unsloth.exe' with working directory 'C:\'. Access is denied.At line:2472 char:9
+         & $UnslothExe @studioArgs
+         ~~~~~~~~~~~~~~~~~~~~~~~~~

Trying to launch it manually from the folder in question, no luck:

PS C:\Users\xxxx\.unsloth\studio\unsloth_studio\Scripts> unsloth studio -H 0.0.0.0 -p 8888
unsloth: The term 'unsloth' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

[General Feedback]
  The command "unsloth" was not found, but does exist in the current location.
  PowerShell does not load commands from the current location by default (see 'Get-Help about_Command_Precedence').

  If you trust this command, run the following command instead:
    > .\unsloth

Following the "General feedback", not better:

PS C:\Users\xxxx\.unsloth\studio\unsloth_studio\Scripts> .\unsloth
ResourceUnavailable: Program 'unsloth.exe' failed to run: An error occurred trying to start process 'C:\Users\xxxx\.unsloth\studio\unsloth_studio\Scripts\unsloth.exe' with working directory 'C:\Users\xxxx\.unsloth\studio\unsloth_studio\Scripts'. Access is denied.At line:1 char:1
+ .\unsloth
+ ~~~~~~~~~.

Where do I go from here?

  1. Did you update? pip install --upgrade unsloth unsloth_zoo - Fresh install
  2. Colab or Kaggle or local / cloud - N/A
  3. Number GPUs used, use nvidia-smi - N/A
  4. Which notebook? Please link! - N/A
  5. Which Unsloth version, TRL version, transformers version, PyTorch version? -N/A
  6. Which trainer? SFTTrainer, GRPOTrainer etc - N/A

Activity

  1. oobabooga commented on Jul 15, 2026

    @oobabooga
    Member

    This isn't an installer bug. Everything builds fine, and it only fails when it runs unsloth.exe, with Access is denied. The manual .\unsloth.exe run gives the same error, so Windows itself is blocking that exe.

    That's usually antivirus/Defender or an AppLocker policy blocking executables under the user profile. To confirm, run the interpreter directly (skips the exe):

    & "$env:USERPROFILE\.unsloth\studio\unsloth_studio\Scripts\python.exe" -m unsloth studio -H 0.0.0.0 -p 8888

    If that works, the block is on the exe specifically.

  2. ArnaudContet commented on Jul 16, 2026

    @ArnaudContet
    Author

    Better, but still not all the way:

    PS C:\> & "$env:USERPROFILE\.unsloth\studio\unsloth_studio\Scripts\python.exe" -m unsloth studio -H 0.0.0.0 -p 8888
    🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.
    W0716 11:39:38.982000 25368 Users\xxxx\.unsloth\studio\unsloth_studio\Lib\site-packages\torch\distributed\elastic\multiprocessing\redirects.py:29] NOTE: Redirects are currently not supported in Windows or MacOs.
    Accessing `is_flash_linear_attention_available` from `.models.aria.image_processing_aria`. Returning `is_flash_linear_attention_available` instead. Behavior may be different and this alias will be removed in future versions.
    
    [...dozens of lines like this...]
    
    Accessing `is_flash_linear_attention_available` from `.models.zoedepth.image_processing_zoedepth`. Returning `is_flash_linear_attention_available` instead. Behavior may be different and this alias will be removed in future versions.
    🦥 Unsloth Zoo will now patch everything to make training faster!
    C:\Users\xxxx\.unsloth\studio\unsloth_studio\Scripts\python.exe: No module named unsloth.__main__; 'unsloth' is a package and cannot be directly executed
    PS C:\>
    
  3. oobabooga commented on Jul 16, 2026

    @oobabooga
    Member

    That output confirms only unsloth.exe is blocked. Python itself ran and loaded unsloth fine, so the block is on that one executable, which is why it's antivirus/Defender or an AppLocker policy rather than the install.

    To launch Studio now, use the exe's real entry point:

    & "$env:USERPROFILE\.unsloth\studio\unsloth_studio\Scripts\python.exe" -c "from unsloth_cli import app; app()" studio -H 0.0.0.0 -p 8888

    That runs the same thing unsloth.exe would. To fix it properly, unblock unsloth.exe under Windows Security > Protection history, or whatever policy is blocking executables in your user profile.

  4. ArnaudContet commented on Jul 16, 2026

    @ArnaudContet
    Author

    More errors, it looks like the installer just never completed correctly:

    PS C:\> & "$env:USERPROFILE\.unsloth\studio\unsloth_studio\Scripts\python.exe" -c "from unsloth_cli import app; app()" studio -H 0.0.0.0 -p 8888
    ╭───────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────╮
    │ C:\Users\xxxx\.unsloth\studio\unsloth_studio\Lib\site-packages\unsloth_cli\commands\studio.py:906 in studio_default  │
    │                                                                                                                      │
    │    903 │   │   │   typer.echo("Studio not set up. Run install.sh first.")                                            │
    │    904 │   │   │   raise typer.Exit(1)                                                                               │
    │    905 │                                                                                                             │
    │ ❱  906 │   run_mod = _load_run_module()                                                                              │
    │    907 │   run_server = run_mod.run_server                                                                           │
    │    908 │                                                                                                             │
    │    909 │   if not silent:                                                                                            │
    │                                                                                                                      │
    │ C:\Users\xxxx\.unsloth\studio\unsloth_studio\Lib\site-packages\unsloth_cli\commands\studio.py:255 in                 │
    │ _load_run_module                                                                                                     │
    │                                                                                                                      │
    │    252 │   module = importlib.util.module_from_spec(spec)                                                            │
    │    253 │   sys.modules["studio.backend.run"] = module                                                                │
    │    254 │   try:                                                                                                      │
    │ ❱  255 │   │   spec.loader.exec_module(module)                                                                       │
    │    256 │   except Exception:                                                                                         │
    │    257 │   │   sys.modules.pop("studio.backend.run", None)                                                           │
    │    258 │   │   raise                                                                                                 │
    │ in exec_module:1023                                                                                                  │
    │ in _call_with_frames_removed:488                                                                                     │
    │                                                                                                                      │
    │ C:\Users\xxxx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\run.py:109 in <module>                 │
    │                                                                                                                      │
    │    106 # See: https://github.com/python/cpython/issues/102396                                                        │
    │    107 import _platform_compat  # noqa: F401                                                                         │
    │    108                                                                                                               │
    │ ❱  109 from loggers import get_logger                                                                                │
    │    110 from startup_banner import print_studio_access_banner, print_studio_stop_hint                                 │
    │    111                                                                                                               │
    │    112 logger = get_logger(__name__)                                                                                 │
    │                                                                                                                      │
    │ C:\Users\xxxx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\loggers\__init__.py:4 in <module>      │
    │                                                                                                                      │
    │   1 # SPDX-License-Identifier: AGPL-3.0-only                                                                         │
    │   2 # Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0             │
    │   3                                                                                                                  │
    │ ❱ 4 from .handlers import get_logger                                                                                 │
    │   5                                                                                                                  │
    │   6 __all__ = ["get_logger"]                                                                                         │
    │   7                                                                                                                  │
    │                                                                                                                      │
    │ C:\Users\xxxx\.unsloth\studio\unsloth_studio\Lib\site-packages\studio\backend\loggers\handlers.py:15 in <module>     │
    │                                                                                                                      │
    │    12 import re                                                                                                      │
    │    13 import time                                                                                                    │
    │    14                                                                                                                │
    │ ❱  15 import structlog                                                                                               │
    │    16 from starlette.types import ASGIApp, Message, Receive, Scope, Send                                             │
    │    17                                                                                                                │
    │    18 from utils.native_path_leases import redact_native_paths                                                       │
    ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
    ModuleNotFoundError: No module named 'structlog'
    

    It's definitely Windows Defender blocking unsloth.

    I did not think of this because I have a bunch of other softwares installed (by default or because they did not ask me) in my user profile. Some of their executables are stored in C:\Users\xxxx\AppData and run fine, but some others are blocked still even there. pip is blocked very consistently. Sometimes python3.14 is blocked as well, but I've still been able to execute some scripts, not sure if it's due to changed policies since or some inconsistency.
    Defender is completely silent about the blocks too, so troubleshooting starts from no hint at all.

    I'll have to speak to my IT admin how to unblock this.

    Anyway, thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions