# Install sentencepiece with Homebrew, apt, MacPorts, Nix, dnf

Unsupervised text tokenizer and detokenizer. Version 0.2.2 via Homebrew; verified 2026-07-12. Also installable with debian: sudo apt install libsentencepiece-dev.

## Install

```sh
sudo av install brew:sentencepiece
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install sentencepiece
```

  Evidence: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install sentencepiece
```

  Evidence: MacPorts ports tree: textproc/sentencepiece/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Debian apt (92%):

```sh
sudo apt install sentencepiece
```

  Evidence: Debian stable package indexes: sentencepiece from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#sentencepiece
```

  Evidence: nixpkgs package indexes: pkgs/by-name/se/sentencepiece/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- dnf (92%):

```sh
sudo dnf install python3-sentencepiece
```

  Evidence: Fedora Rawhide package metadata: python3-sentencepiece from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

## Package facts

- **Package key:** brew:sentencepiece
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/sentencepiece>
- **Version:** 0.2.2
- **Source summary:** Unsupervised text tokenizer and detokenizer
- **Homepage:** <https://github.com/google/sentencepiece>
- **Repository:** <https://github.com/google/sentencepiece>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/google/sentencepiece/archive/refs/tags/v0.2.2.tar.gz>
- **Last updated:** 2026-07-12T10:12:13Z
- **Generated:** 2026-08-04T22:13:35+00:00

## Executables

- spm_decode (cli)
- spm_encode (cli)
- spm_export_vocab (cli)
- spm_normalize (cli)
- spm_train (cli)
- spm_decode (alias)
- spm_encode (alias)
- spm_export_vocab (alias)
- spm_normalize (alias)
- spm_train (alias)

## Build dependencies

- cmake

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-08-04
- Package-manager version: 0.2.2
- Package-manager updated: 2026-07-12
- Local data: ok
- Upstream repository: https://github.com/google/sentencepiece
- Upstream latest detected: v0.2.2 (current)

## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** sentencepiece
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Debian apt - libsentencepiece-dev - 0.2.0-1+b3: normalized package name match | Debian stable package indexes: libsentencepiece-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Header files of SentencePiece | https://github.com/google/sentencepiece
- Debian apt - libsentencepiece0 - 0.2.0-1+b3: normalized package name match | Debian stable package indexes: libsentencepiece0 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Library files of SentencePiece | https://github.com/google/sentencepiece
- Debian apt - python3-sentencepiece - 0.2.0-1+b3: normalized package name match | Debian stable package indexes: python3-sentencepiece from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SentencePiece binding for Python3 | https://github.com/google/sentencepiece
- Debian apt - sentencepiece - 0.2.0-1+b3: normalized package name match | Debian stable package indexes: sentencepiece from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Unsupervised text tokenizer and detokenizer | https://github.com/google/sentencepiece
- Nix - sentencepiece: normalized package name match | nixpkgs package indexes: pkgs/by-name/se/sentencepiece/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libsentencepiece-dev - 0.2.0-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsentencepiece-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Header files of SentencePiece | https://github.com/google/sentencepiece
- Ubuntu apt - libsentencepiece0 - 0.2.0-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libsentencepiece0 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Library files of SentencePiece | https://github.com/google/sentencepiece
- Ubuntu apt - python3-sentencepiece - 0.2.0-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-sentencepiece from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | SentencePiece binding for Python3 | https://github.com/google/sentencepiece
- Ubuntu apt - sentencepiece - 0.2.0-1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: sentencepiece from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Unsupervised text tokenizer and detokenizer | https://github.com/google/sentencepiece
- dnf - python3-sentencepiece - 0.2.1-4.fc45: normalized package name match | Fedora Rawhide package metadata: python3-sentencepiece from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Python module for SentencePiece | https://github.com/google/sentencepiece
- dnf - sentencepiece-devel - 0.2.1-4.fc45: normalized package name match | Fedora Rawhide package metadata: sentencepiece-devel from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Libraries and header files for SentencePiece | https://github.com/google/sentencepiece
- dnf - sentencepiece-libs - 0.2.1-4.fc45: normalized package name match | Fedora Rawhide package metadata: sentencepiece-libs from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Runtime libraries for SentencePiece | https://github.com/google/sentencepiece
- dnf - sentencepiece-tools - 0.2.1-4.fc45: normalized package name match | Fedora Rawhide package metadata: sentencepiece-tools from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | Tools for SentencePiece | https://github.com/google/sentencepiece
- MacPorts - sentencepiece: normalized package name match | MacPorts ports tree: textproc/sentencepiece/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Related links

- [Source-control packages](https://pkg.so/source-control-tools/) - Belongs to a source-control command family.
- [MCP tool packages](https://pkg.so/mcp-tools/) - Mentions MCP or Model Context Protocol.
- [AI and agent packages](https://pkg.so/ai-agent-tools/) - Matched AI model, agent, coding-agent, orchestration, or MCP metadata.
- [Terminal utility packages](https://pkg.so/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [cmake](https://pkg.so/brew/cmake/) - Build dependency declared by Homebrew.
- [mlx-lm](https://pkg.so/brew/mlx-lm/) - Popular package that depends on this formula.
- [apache-opennlp](https://pkg.so/brew/apache-opennlp/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools, nlp.
- [text-embeddings-inference](https://pkg.so/brew/text-embeddings-inference/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools, nlp.
- [mitie](https://pkg.so/brew/mitie/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools, nlp.
- [yamcha](https://pkg.so/brew/yamcha/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools, nlp.
- [tesseract](https://pkg.so/brew/tesseract/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [opencv](https://pkg.so/brew/opencv/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [pytorch](https://pkg.so/brew/pytorch/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [mlx](https://pkg.so/brew/mlx/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [djl-serving](https://pkg.so/brew/djl-serving/) - Local package facts share a topical domain. Shared terms: ai, cli, learning, machine, machine-learning.
- [ncnn](https://pkg.so/brew/ncnn/) - Local package facts share a topical domain. Shared terms: ai, cli, learning, machine, machine-learning.

## Combined YAML source

View the package source record on GitHub. [combined/sentencepiece.yml](https://github.com/mxcl/pkgdb/blob/main/combined/sentencepiece.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
