sentencepiece
sentencepiece copied to clipboard
The pip command to install the SentencePiece Python module fails.
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
╰─> [108 lines of output]
/tmp/pip-build-env-fvng4eb3/overlay/lib/python3.13/site-packages/setuptools/_distutils/dist.py:261: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
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' not found
./build_bundled.sh: line 21: cmake: command not found
./build_bundled.sh: line 22: cmake: command not found
Traceback (most recent call last):
File "/home/tprrt/venv/lib64/python3.13/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in
Indeed, same problem for me (and a friend who also tested), both running on Arch Linux.
I suspect this came from the upgrade to Python 3.13, but I'm not sure.
Try installing cmake first. As per the following excerpt from your log file, cmake command cannot be found.
./build_bundled.sh: line 21: cmake: command not found
./build_bundled.sh: line 22: cmake: command not found
In MacOS, you can use brew: brew install cmake
In Debian-based Linux, you can use apt: sudo apt install cmake
Try installing
cmakefirst. As per the following excerpt from your log file,cmakecommand cannot be found.
This was the trick, thank you! I can install SentencePiece on Arch now.
pip install cmake was the solution.
I've installed cmake, both via my distro package manager and via pip in the conda env, and I'm still getting the same error.
Same here
Same here
The issue is that this branch is not yet released #1084 so until it's released it won't work on 3.13
Closed by #1120
Fixed in https://github.com/google/sentencepiece/releases/tag/v0.2.1