sentencepiece icon indicating copy to clipboard operation
sentencepiece copied to clipboard

`pip install sentencepiece` failing on Windows and Python3.13

Open ninofiliu opened this issue 8 months ago • 9 comments

As the title says

Tried all versions from 0.1.95 to 0.2.0

Fixed it by using python 3.11 instead

Error log on python 3.13 and sentencepiece 0.2.0:

(venv) PS D:\ComfyUI> pip install sentencepiece
Collecting sentencepiece
  Using cached sentencepiece-0.2.0.tar.gz (2.6 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      Traceback (most recent call last):
        File "D:\ComfyUI\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 389, in <module>
          main()
          ~~~~^^
        File "D:\ComfyUI\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
        File "D:\ComfyUI\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 143, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\ninof\AppData\Local\Temp\pip-build-env-feogowmk\overlay\Lib\site-packages\setuptools\build_meta.py", line 334, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ninof\AppData\Local\Temp\pip-build-env-feogowmk\overlay\Lib\site-packages\setuptools\build_meta.py", line 304, in _get_build_requires
          self.run_setup()
          ~~~~~~~~~~~~~~^^
        File "C:\Users\ninof\AppData\Local\Temp\pip-build-env-feogowmk\overlay\Lib\site-packages\setuptools\build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
          ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ninof\AppData\Local\Temp\pip-build-env-feogowmk\overlay\Lib\site-packages\setuptools\build_meta.py", line 320, in run_setup
          exec(code, locals())
          ~~~~^^^^^^^^^^^^^^^^
        File "<string>", line 128, in <module>
        File "C:\Users\ninof\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 416, in check_call
          retcode = call(*popenargs, **kwargs)
        File "C:\Users\ninof\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 397, in call
          with Popen(*popenargs, **kwargs) as p:
               ~~~~~^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\ninof\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1038, 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\ninof\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1550, 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: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

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

ninofiliu avatar Apr 06 '25 16:04 ninofiliu

Same issue in OSx

Python 3.13.2 pip 25.0.1

exengstfeld avatar Apr 08 '25 21:04 exengstfeld

build it from source: git clone https://github.com/google/sentencepiece.git cd sentencepiece mkdir build cd build cmake .. -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=./root make install cd ../python python setup.py bdist_wheel pip install dist/sentencepiece*.whl

ndependentfox avatar Apr 09 '25 14:04 ndependentfox

Same problem, python 3.13

takeraparterer avatar Apr 10 '25 06:04 takeraparterer

I built a wheel for my python 3.13.3 environment.

I'm dropping it here: sentencepiece-0.2.1-cp313-cp313-win_amd64.whl

NeoAnthropocene avatar Apr 14 '25 23:04 NeoAnthropocene

I built a wheel for my python 3.13.3 environment.

I'm dropping it here: sentencepiece-0.2.1-cp313-cp313-win_amd64.whl

This wheel has installed fine great.

But as a developer still I don't know having everything VC++ installed and cmake generated why make install gives linker errors while building from source in win 11 with MS VS 2022

TimexPeachtree avatar Apr 15 '25 05:04 TimexPeachtree

I built a wheel for my python 3.13.3 environment.

I'm dropping it here: sentencepiece-0.2.1-cp313-cp313-win_amd64.whl

This wheel has installed fine great.

But as a developer still I don't know having everything VC++ installed and cmake generated why make install gives linker errors while building from source in win 11 with MS VS 2022

Oh, tell me about it. I spent 1 hour to solve the build problems with Gemini 😄

NeoAnthropocene avatar Apr 15 '25 20:04 NeoAnthropocene

install by conda works fine

Moloch0 avatar Apr 19 '25 09:04 Moloch0

I built a wheel for my python 3.13.3 environment.

I'm dropping it here: sentencepiece-0.2.1-cp313-cp313-win_amd64.whl

Lifesaver, thank you for this

Reksoatr avatar Apr 28 '25 19:04 Reksoatr

build it from source: git clone https://github.com/google/sentencepiece.git cd sentencepiece mkdir build cd build cmake .. -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=./root make install cd ../python python setup.py bdist_wheel pip install dist/sentencepiece*.whl

I've been fighting this for days. This is the only thing that worked. You are a hero.

definitelynotaspren avatar May 16 '25 04:05 definitelynotaspren

Closed by #1120

crusaderky avatar Jun 27 '25 13:06 crusaderky

Fixed in https://github.com/google/sentencepiece/releases/tag/v0.2.1

taku910 avatar Aug 12 '25 07:08 taku910