unsloth icon indicating copy to clipboard operation
unsloth copied to clipboard

Windows Direct Install issue

Open areebuzair opened this issue 9 months ago • 3 comments

On windows 11, Python 3.13.1, pip 25.0.1, Cuda 12.6 and PyTorch 2.6.0, I get the following error while running pip install "unsloth[windows] @ git+https://github.com/unslothai/unsloth.git"

I have MSVC installed.

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
          exec(compile('''
          ~~~~^^^^^^^^^^^^
          # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ...<31 lines>...
          exec(compile(setup_py_code, filename, "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ''' % ('C:\\Users\\User\\AppData\\Local\\Temp\\pip-install-d8xxa6co\\sentencepiece_dbec9d070be34a3d81fb9fce469c2290\\setup.py',), "<pip-setuptools-caller>", "exec"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\User\AppData\Local\Temp\pip-install-d8xxa6co\sentencepiece_dbec9d070be34a3d81fb9fce469c2290\setup.py", line 128, in <module>
          subprocess.check_call([
          ~~~~~~~~~~~~~~~~~~~~~^^
              'cmake',
              ^^^^^^^^
          ...<6 lines>...
              '-DCMAKE_INSTALL_PREFIX=build\\root',
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          ])
          ^^
        File "C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 414, in check_call
          retcode = call(*popenargs, **kwargs)
        File "C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 395, in call
          with Popen(*popenargs, **kwargs) as p:
               ~~~~~^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1036, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                              pass_fds, cwd, env,
                              ^^^^^^^^^^^^^^^^^^^
          ...<5 lines>...
                              gid, gids, uid, umask,
                              ^^^^^^^^^^^^^^^^^^^^^^
                              start_new_session, process_group)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\User\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1548, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                             ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                                   # no special security
                                   ^^^^^^^^^^^^^^^^^^^^^
          ...<4 lines>...
                                   cwd,
                                   ^^^^
                                   startupinfo)
                                   ^^^^^^^^^^^^
      FileNotFoundError: [WinError 2] The system cannot find the file specified
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

areebuzair avatar Mar 02 '25 10:03 areebuzair

Wait I don't think Python 3.13 is supported yet! Maybe that's the issue. I'm not 100% sure though

danielhanchen avatar Mar 02 '25 11:03 danielhanchen

Wait I don't think Python 3.13 is supported yet! Maybe that's the issue. I'm not 100% sure though

This is indeed the case for sentencepiece - there's no Python 3.13 wheels on PyPI for it.

Since you're looking to build that package (and possibly others) from source, you'd want to make sure you have cmake installed, which you may already have in your VS2022 environment. The simplest thing to do is to use the x64 developer command prompt.

Alternatively, you may have an easier time with Python 3.12.

matthewdouglas avatar Mar 02 '25 20:03 matthewdouglas

Switched to Python 12.9

areebuzair avatar Mar 03 '25 05:03 areebuzair