Skip to content

[Bug] Unsloth Studio Installer Fails When PyPI.org Is Unreachable Despite Local Wheel Availability and Installation #6025

Closed as not planned

Description

@victorxstc

Summary

The Unsloth Studio installer/update process ( irm https://unsloth.ai/install.ps1 | iex ) fails when PyPI.org is inaccessible, even if the required (latest) Unsloth wheel has already been manually downloaded and successfully installed into the target virtual environment.

The installer appears to require live access to https://pypi.org/simple/unsloth/ and aborts if that endpoint cannot be reached. This prevents updates in regions where PyPI.org is unreachable (and the Wheel needs to be downloaded and installed separately) despite all required packages potentially being available locally. (PyPi.org domain and other .org domains may be blocked or intermittently unavailable; hence, manual download and installation of the latest Unsloth PyPi).

I think this is a bug because the manually downloaded wheel installed successfully. The failure seems to occur specifically because the installer always attempts to reach: https://pypi.org/simple/unsloth/ and aborts if that request fails. This suggests the issue is with installer behavior rather than package installation itself. The Unsloth Studio installer seems to have no documented offline or local-wheel path, even though the underlying Python tooling (pip and uv) can support such workflows.

Adding an offline or local-wheel installation path would make Unsloth Studio setup substantially more robust and easier to deploy in restricted environments.

Environment

  • Operating System: Windows 10
  • Python: 3.13.9
  • Unsloth Studio installation path: C:\Users\u\.unsloth\studio\unsloth_studio
  • Existing Unsloth version: 2026.5.9
  • Attempted update version: 2026.6.1
  • Installer command: powershell irm https://unsloth.ai/install.ps1 | iex

Background

PyPI (pypi.org) is currently inaccessible from my region without a VPN. Even with a VPN too, it is inaccessible from PowerShell; it is only accessible with a VPN and also from the browser.

To work around this, I manually downloaded unsloth-2026.6.1-py3-none-any.whl and successfully installed it into the Unsloth Studio virtual environment using pip. The manual wheel installation succeeded, using the following PS command; upon re-running the same command, PS confirms that it is installed:

PS C:\Windows\system32> C:\Users\u\.unsloth\studio\unsloth_studio\Scripts\python.exe -m pip install --upgrade --no-deps "C:\unsloth-2026.6.1-py3-none-any.whl"
Processing C:\unsloth-2026.6.1-py3-none-any.whl
unsloth is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.

However, running the official installer/update command still fails because it attempts to contact PyPI.org regardless of whether the package is already installed locally.

Reproduction Steps

  1. Install Unsloth Studio normally.
  2. Ensure that pypi.org is unreachable (network restriction, firewall, regional block, etc.).
  3. Download the latest Unsloth wheel manually.
  4. Install the wheel into the existing Unsloth Studio virtual environment (using PS C:\Windows\system32> C:\Users\u\.unsloth\studio\unsloth_studio\Scripts\python.exe -m pip install --upgrade --no-deps "C:\unsloth-2026.6.1-py3-none-any.whl" ).
  5. Run PS irm https://unsloth.ai/install.ps1 | iex

Actual Behavior

The installer creates/restores the virtual environment and then attempts to install or upgrade Unsloth using uv. The process fails with:

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

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

  winget         available
  python         Python 3.13 already installed
                 preserving existing environment for rollback...
                 previous environment preserved for rollback
  venv           creating Python 3.13 virtual environment
                 C:\Users\u\.unsloth\studio\unsloth_studio
  gpu            NVIDIA GPU detected
                 installing PyTorch (https://download.pytorch.org/whl/cu130)...
                 installing unsloth (this may take a few minutes)...
uv : Using Python 3.13.9 environment at: C:\Users\u\.unsloth\studio\unsloth_studio
At line:1657 char:56
+ ... llCommand { uv pip install --python $VenvPython --upgrade-package uns ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Using Python 3....\unsloth_studio:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

error: Request failed after 3 retries in 52.6s
  Caused by: Failed to fetch: `https://pypi.org/simple/unsloth/`
  Caused by: error sending request for url (https://pypi.org/simple/unsloth/)
  Caused by: client error (Connect)
  Caused by: operation timed out

[ERROR] Failed to install unsloth (exit code 2)
                 restoring previous environment after failed install...
                 restored previous environment

Expected Behavior: The installer should support one or more of the following:


Expected Behavior 1: Local Wheel Fallback

If a local wheel is available, allow installation from that wheel without contacting PyPI. Example: powershell install.ps1 -WheelPath C:\unsloth-2026.6.1-py3-none-any.whl


Expected Behavior 2: Offline Mode

Provide an offline installation/update mode. Example: powershell install.ps1 -Offline or powershell install.ps1 -WheelDirectory D:\OfflineWheels


Expected Behavior 3: Reuse Existing Installation

If the target version is already installed in the virtual environment, avoid contacting PyPI.org solely for version discovery.


Expected Behavior 4: Configurable Package Index

Allow users to specify: powershell -PackageIndex <url> or powershell --find-links <directory> for private mirrors and offline wheel repositories.


Conclusion

The manually downloaded wheel installed successfully. The failure seems to occur specifically because the installer always attempts to reach: https://pypi.org/simple/unsloth/ and aborts if that request fails. This suggests the issue is with installer behavior rather than package installation itself. The current installer already performs rollback and environment preservation, which is excellent. Adding an offline/local-wheel installation path would make Unsloth Studio substantially more robust and easier to deploy in restricted environments.

Activity

  1. Imagineer99 commented on Jun 9, 2026

    @Imagineer99
    Member

    This looks valid. Current Windows installer does not have a supported offline or local-wheel install path.

  2. Imagineer99 commented on Jun 9, 2026

    @Imagineer99
    Member

    Will consider adding an offline mirror mode such as --wheel-path.

  3. added
    feature request
    and removed on Jun 9, 2026
  4. victorxstc commented on Jun 9, 2026

    @victorxstc
    Author

    Thanks @Imagineer99.

  5. danielhanchen commented on Oct 15, 2026

    @danielhanchen
    Member

    Thanks for the detailed report, and sorry on the delay! We won't add a separate -WheelPath / -Offline switch for now, but the installer already has ways around a blocked PyPI that should cover this.

    Proxy. Since PyPI works for you in the browser over the VPN, point the installer at the VPN's local proxy. The standard HTTPS_PROXY / HTTP_PROXY / ALL_PROXY variables are respected by the installer's package downloads (uv, pip, Python), and a PowerShell Invoke-WebRequest:Proxy default is kept, so in the same PowerShell window:

    $env:HTTPS_PROXY = "http://127.0.0.1:<your VPN's proxy port>"; $env:HTTP_PROXY = $env:HTTPS_PROXY
    irm https://unsloth.ai/install.ps1 | iex

    Mirror fallback. With UNSLOTH_MIRROR_FALLBACK=1 the installer switches PyPI (and download.pytorch.org, nodejs.org, npm) to the Tsinghua / CERNET and npmmirror mirrors when they are blocked or very slow. It turns on by itself only in mainland China:

    $env:UNSLOTH_MIRROR_FALLBACK = "1"; irm https://unsloth.ai/install.ps1 | iex

    Your own mirror or the local cache. $env:UV_DEFAULT_INDEX = "https://<mirror>/simple" points every PyPI install at a mirror you can reach. $env:UV_OFFLINE = "1" re-runs the install from the packages already in Unsloth's local cache without contacting PyPI, and adding $env:UV_FIND_LINKS = "C:\wheels" lets it pick up wheels you downloaded yourself (put every new wheel it needs there, e.g. both unsloth and unsloth_zoo).

    We tested this on Windows with pypi.org and files.pythonhosted.org blocked: without any of these the re-run fails exactly like your log, and with UNSLOTH_MIRROR_FALLBACK=1, UV_DEFAULT_INDEX or UV_OFFLINE=1 it completes and Unsloth Studio starts.

    Docker. For a machine with no usable internet at all, the unsloth/unsloth Docker image works fully offline: docker pull and docker save it on a connected machine, then docker load it on the offline one.

    I'll close this for now, but feel free to reopen if the installer still fails with one of these set, and paste the log.

  6. danielhanchen commented on Oct 15, 2026

    @danielhanchen
    Member

    Also we now have a Docker which is contained if that helps

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

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions