Visitar URL original
PIP INSTALL failing on OSX · Issue #1103 · google/sentencepiece · GitHub
Skip to content

PIP INSTALL failing on OSX #1103

Closed
Closed

Description

@tregenza

Python 3.13.1
Apple M2
OSX 13.7.1

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 ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: sentencepiece
Building wheel for sentencepiece (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for sentencepiece (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [124 lines of output]
/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

          ********************************************************************************
          Please consider removing the following classifiers in favor of a SPDX license expression:
  
          License :: OSI Approved :: Apache Software License
  
          See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
          ********************************************************************************
  
  !!
    self._finalize_license_expression()
  running bdist_wheel
  running build
  running build_py
  creating build/lib.macosx-10.13-universal2-cpython-313/sentencepiece
  copying src/sentencepiece/__init__.py -> build/lib.macosx-10.13-universal2-cpython-313/sentencepiece
  copying src/sentencepiece/_version.py -> build/lib.macosx-10.13-universal2-cpython-313/sentencepiece
  copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.macosx-10.13-universal2-cpython-313/sentencepiece
  copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.macosx-10.13-universal2-cpython-313/sentencepiece
  running build_ext
  Package sentencepiece was not found in the pkg-config search path.
  Perhaps you should add the directory containing `sentencepiece.pc'
  to the PKG_CONFIG_PATH environment variable
  Package 'sentencepiece' not found
  ./build_bundled.sh: line 21: cmake: command not found
  ./build_bundled.sh: line 22: nproc: command not found
  ./build_bundled.sh: line 22: cmake: command not found
  Traceback (most recent call last):
    File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
      main()
      ~~~~^^
    File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
      json_out["return_val"] = hook(**hook_input["kwargs"])
                               ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
      return _build_backend().build_wheel(
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
          wheel_directory, config_settings, metadata_directory
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      )
      ^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 438, in build_wheel
      return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 426, in _build
      return self._build_with_temp_dir(
             ~~~~~~~~~~~~~~~~~~~~~~~~~^
          cmd,
          ^^^^
      ...<3 lines>...
          self._arbitrary_args(config_settings),
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      )
      ^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
      self.run_setup()
      ~~~~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
      super().run_setup(setup_script=setup_script)
      ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
      exec(code, locals())
      ~~~~^^^^^^^^^^^^^^^^
    File "<string>", line 169, in <module>
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 117, in setup
      return distutils.core.setup(**attrs)
             ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 186, in setup
      return run_commands(dist)
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
      dist.run_commands()
      ~~~~~~~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
      self.run_command(cmd)
      ~~~~~~~~~~~~~~~~^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
      self.run_command("build")
      ~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build.py", line 135, in run
      self.run_command(cmd_name)
      ~~~~~~~~~~~~~~~~^^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
      self.distribution.run_command(command)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
      super().run_command(command)
      ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
      cmd_obj.run()
      ~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/command/build_ext.py", line 99, in run
      _build_ext.run(self)
      ~~~~~~~~~~~~~~^^^^^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run
      self.build_extensions()
      ~~~~~~~~~~~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 484, in build_extensions
      self._build_extensions_serial()
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    File "/private/var/folders/_2/_1tsfrlj77g_jgw20lh_9dsr0000gn/T/pip-build-env-bp9reytw/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 510, in _build_extensions_serial
      self.build_extension(ext)
      ~~~~~~~~~~~~~~~~~~~~^^^^^
    File "<string>", line 87, in build_extension
    File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 419, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.2.0']' returned non-zero exit status 127.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for sentencepiece
Failed to build sentencepiece
ERROR: Failed to build installable wheels for some pyproject.toml based projects (sentencepiece)

Activity

  1. exdysa commented on Apr 2, 2025

    @exdysa

    Error received via github actions.
    python 3.13.2
    pip-25.0.1
    setuptools-78.1.0-py3-none-any
    attempted build process on sentencepiece-0.2.0.tar.gz

    This is part of a runner that installs from org repo

      Building wheel for sentencepiece (pyproject.toml): started
      Building wheel for sentencepiece (pyproject.toml): finished with status 'error'
      error: subprocess-exited-with-error
      
      × Building wheel for sentencepiece (pyproject.toml) did not run successfully.
      │ exit code: 1
      ╰─> [133 lines of output]
          /tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite'
            warnings.warn(msg)
          /tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
          !!
          
                  ********************************************************************************
                  Please consider removing the following classifiers in favor of a SPDX license expression:
          
                  License :: OSI Approved :: Apache Software License
          
                  See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
                  ********************************************************************************
          
          !!
            self._finalize_license_expression()
          running bdist_wheel
          running build
          running build_py
          creating build/lib.linux-x86_64-cpython-313/sentencepiece
          copying src/sentencepiece/__init__.py -> build/lib.linux-x86_64-cpython-313/sentencepiece
          copying src/sentencepiece/_version.py -> build/lib.linux-x86_64-cpython-313/sentencepiece
          copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.linux-x86_64-cpython-313/sentencepiece
          copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.linux-x86_64-cpython-313/sentencepiece
          running build_ext
          Package sentencepiece was not found in the pkg-config search path.
          Perhaps you should add the directory containing `sentencepiece.pc'
          to the PKG_CONFIG_PATH environment variable
          Package 'sentencepiece', required by 'virtual:world', not found
          CMake Error at CMakeLists.txt:15 (cmake_minimum_required):
            Compatibility with CMake < 3.5 has been removed from CMake.
          
            Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
            to tell CMake that the project requires at least <min> but has been updated
            to work with policies introduced by <max> or earlier.
          
            Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
          
          
          -- Configuring incomplete, errors occurred!
          Error: could not find CMAKE_PROJECT_NAME in Cache
          Traceback (most recent call last):
            File "/home/runner/work/nnll/nnll/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
              main()
              ~~~~^^
            File "/home/runner/work/nnll/nnll/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
              json_out["return_val"] = hook(**hook_input["kwargs"])
                                       ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
            File "/home/runner/work/nnll/nnll/.venv/lib/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel
              return _build_backend().build_wheel(
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
                  wheel_directory, config_settings, metadata_directory
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              )
              ^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 438, in build_wheel
              return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 426, in _build
              return self._build_with_temp_dir(
                     ~~~~~~~~~~~~~~~~~~~~~~~~~^
                  cmd,
                  ^^^^
              ...<3 lines>...
                  self._arbitrary_args(config_settings),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              )
              ^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 407, in _build_with_temp_dir
              self.run_setup()
              ~~~~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 522, in run_setup
              super().run_setup(setup_script=setup_script)
              ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/build_meta.py", line 320, in run_setup
              exec(code, locals())
              ~~~~^^^^^^^^^^^^^^^^
            File "<string>", line 169, in <module>
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/__init__.py", line 117, in setup
              return distutils.core.setup(**attrs)
                     ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 186, in setup
              return run_commands(dist)
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
              dist.run_commands()
              ~~~~~~~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
              self.run_command(cmd)
              ~~~~~~~~~~~~~~~~^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
              super().run_command(command)
              ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
              cmd_obj.run()
              ~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
              self.run_command("build")
              ~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
              self.distribution.run_command(command)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
              super().run_command(command)
              ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
              cmd_obj.run()
              ~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build.py", line 135, in run
              self.run_command(cmd_name)
              ~~~~~~~~~~~~~~~~^^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
              self.distribution.run_command(command)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/dist.py", line 1104, in run_command
              super().run_command(command)
              ~~~~~~~~~~~~~~~~~~~^^^^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
              cmd_obj.run()
              ~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/command/build_ext.py", line 99, in run
              _build_ext.run(self)
              ~~~~~~~~~~~~~~^^^^^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 368, in run
              self.build_extensions()
              ~~~~~~~~~~~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 484, in build_extensions
              self._build_extensions_serial()
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
            File "/tmp/pip-build-env-vygqsdc8/overlay/lib/python3.13/site-packages/setuptools/_distutils/command/build_ext.py", line 510, in _build_extensions_serial
              self.build_extension(ext)
              ~~~~~~~~~~~~~~~~~~~~^^^^^
            File "<string>", line 87, in build_extension
            File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/subprocess.py", line 421, in check_call
              raise CalledProcessError(retcode, cmd)
          subprocess.CalledProcessError: Command '['./build_bundled.sh', '0.2.0']' returned non-zero exit status 1.
          [end of output]
      
      note: This error originates from a subprocess, and is likely not a problem with pip.
      ERROR: Failed building wheel for sentencepiece
    

    Note that this is on a remote AMD linux box running Ubuntu (different than initial post), and that this project uses setuptools (same as initial post)

    Attempted fixes:

    • sudo apt-get -y install cmake
    • env CMAKE_POLICY_VERSION_MINIMUM=3.5

    thanks @karlsolomon , python 3.12 solved it here

  2. karlsolomon commented on Apr 2, 2025

    @karlsolomon

    This seems to be an issue in compatibility with python 3.13. I saw the same issue you did with 3.13.2, however when I reverted to both 3.11.11 and 3.12.9 I was able to install sentencepiece.

    Installations failed with both pacman and uv/pip package managers when using python 3.13.

    OS: Linux 6.13.8-arch1-1

  3. Salakksson commented on Apr 5, 2025

    @Salakksson

    i believe the issue is cmake version is being wrongly detected as it went to 4.0.0, downgrading cmake to 3.31.6 fixed the issue for me, i know nothing about this project but it was a dependancy and i had this issue i believe, i dont know if its an issue with this project or something with pip because i dont do python.
    i dont see any reason why the version of a c compiler should ever matter, as long as its not msvc it will probably compile

  4. kamikaze commented on Jun 25, 2025

    @kamikaze

    same on linux/amd64 building in docker.

  5. crusaderky commented on Jun 27, 2025

    @crusaderky
    Contributor

    Closed by #1120

  6. added
    pythonPull requests that update Python code
    on Aug 3, 2025
  7. taku910 commented on Aug 12, 2025

    @taku910
    Collaborator
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

    pythonPull requests that update Python code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions