google / sentencepiece

Unsupervised text tokenizer for Neural Network-based text generation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows pip Dependancy Installation Error

Nick- opened this issue · comments

Hello,

I'm trying to install libretranslate, which works successfully on Linux

However, when trying to pipx install libretranslate on Windows I get the following:

Collecting sentencepiece==0.1.99 (from argostranslate==1.9.1->libretranslate)
  Using cached sentencepiece-0.1.99.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
  ╰─> [31 lines of output]
      Traceback (most recent call last):
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\nicho\AppData\Local\Temp\pip-build-env-jyxbvtu2\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\nicho\AppData\Local\Temp\pip-build-env-jyxbvtu2\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\nicho\AppData\Local\Temp\pip-build-env-jyxbvtu2\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\nicho\AppData\Local\Temp\pip-build-env-jyxbvtu2\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 126, in <module>
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 408, in check_call
          retcode = call(*popenargs, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 389, in call
          with Popen(*popenargs, **kwargs) as p:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1026, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.752.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1538, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      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.
PS C:\Users\nicho> pipx install libretranslate
Fatal error from pip prevented installation. Full pip output in file:
    C:\Users\nicho\AppData\Local\pipx\pipx\Logs\cmd_2024-03-23_15.43.13_pip_errors.log

pip seemed to fail to build package:
    sentencepiece==0.1.99

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    FileNotFoundError: [WinError 2] The system cannot find the file specified

Error installing libretranslate.
PS C:\Users\nicho> pipx install sentencepiece

No apps associated with package sentencepiece or its dependencies. If you are attempting to install a library, pipx
should not be used. Consider using pip or a similar tool instead.
PS C:\Users\nicho> pip install sentencepiece
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: sentencepiece in c:\users\nicho\appdata\local\packages\pythonsoftwarefoundation.python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (0.2.0)
PS C:\Users\nicho> pipx install sentencepiece

No apps associated with package sentencepiece or its dependencies. If you are attempting to install a library, pipx
should not be used. Consider using pip or a similar tool instead.
PS C:\Users\nicho> pipx install libretranslate
Fatal error from pip prevented installation. Full pip output in file:
    C:\Users\nicho\AppData\Local\pipx\pipx\Logs\cmd_2024-03-23_15.46.08_pip_errors.log

pip seemed to fail to build package:
    sentencepiece==0.1.99

Some possibly relevant errors from pip install:
    error: subprocess-exited-with-error
    FileNotFoundError: [WinError 2] The system cannot find the file specified

Error installing libretranslate.

Note: I can pip install sentencepiece but I cannot pip install libretranslate due to the same error.

sentencepeice 0.1.9 doesn't provide pip wheel package for Python 3.12 + windows. So the installer simply tries to build the wheel from scratch. This error is caused because there is no build environment installed.

You might want to try either

  1. use v0.2.0 that supports python3.1.2 + windows
  2. Install build environment. see https://github.com/google/sentencepiece/blob/master/.github/workflows/wheel.yml