Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Python recommendation tools

Automatic Tests codecov Scientific Python Ecosystem Coordination PyPI - Version Conda Version

LensKit is a set of Python tools for experimenting with and studying recommender systems. It provides support for training, running, and evaluating recommender algorithms in a flexible fashion suitable for research and education.

LensKit for Python (LKPY) is the successor to the Java-based LensKit project.

[!IMPORTANT] If you use LensKit for Python in published research, please cite:

Michael D. Ekstrand. 2020. LensKit for Python: Next-Generation Software for Recommender Systems Experiments. In Proceedings of the 29th ACM International Conference on Information and Knowledge Management (CIKM '20). DOI:10.1145/3340531.3412778. arXiv:1809.03125 [cs.IR].

[!NOTE]

LensKit had significant changes in the 2025.1 release. See the Migration Guide for details.

Installing

To install the current release with uv (recommended):

$ uv pip install lenskit

Or, to add it to your project's dependencies and virtual environment:

$ uv add lenskit

Classic pip also works:

$ python -m pip install lenskit

Then see Getting Started

Conda Packages

You can also install LensKit from conda-forge with pixi:

$ pixi add lenskit

Or conda:

$ conda install -c conda-forge lenskit

Development Version

To use the latest development version, you have two options. You can install directly from GitHub:

$ uv pip install -U git+https://github.com/lenskit/lkpy

Or you can use our PyPI index, by adding to pyproject.toml:

[[tool.uv.index]]
name = "lenskit"
url = "https://pypi.lenskit.org/lenskit-dev/"

Binary wheels of LensKit development (and release) versions are automatically pushed to this index, although they are not guaranteed to be permanently available. Reproducible code should generally depend on released versions published to PyPI.

Simplifying PyTorch installation

We also provide mirrors of the PyTorch package repositories that are filtered to only include PyTorch and directly supporting dependencies, without other packages that conflict with or mask packages from PyPI, and with fallbacks for other platforms (i.e., our CUDA indices include CPU-only MacOS packages). This makes it easier to install specific versions of PyTorch in your project with the index priority and fallthrough logic implemented by uv. To make your project only use CPU-based PyTorch, you can add to pyproject.toml:

[[tool.uv.index]]
name = "torch-cpu"
url = "https://pypi.lenskit.org/torch/cpu/"

Or CUDA 12.8:

[[tool.uv.index]]
name = "torch-gpu"
url = "https://pypi.lenskit.org/torch/cu128/"

These indices provide the same package distributions as the official PyTorch repositories (in fact, they link directly to the PyTorch packages). They are just an alternate index view that reduces some package conflicts.

Developing

To contribute to LensKit, clone or fork the repository, get to work, and submit a pull request. We welcome contributions from anyone; if you are looking for a place to get started, see the issue tracker.

Our development workflow is documented in the wiki; the wiki also contains other information on developing LensKit. User-facing documentation is at https://lenskit.org.

We use uv for developing LensKit and managing development environments. Our pyproject.toml file contains the Python development dependencies; you also need a working Rust compiler (typically via rustup). We provide Mise configuration to automatically install everything needed, including uv and rust.

The easiest way to work on LensKit is to use the devcontainer — in Visual Studio Code, Zed, and other editors supporting Dev Containers, just re-open the project in a dev container, and the necessary software will be automatically installed.

[!NOTE]

The Rust compiler needs some memory to work. If your Docker environment is set to a very small memory capacity (e.g. Colima's default of 2GB), the build will fail. Make sure your Docker has at least 4, preferably 8, GB of memory.

[!NOTE]

VS Code may try to connect to Python before the dev container has finished setting up the software dependencies, and prompt you to automatically install Python. Don't click this — let the container setup do it.

[!NOTE]

The dev container is the only supported way to develop on Windows — while LensKit works and is regularly tested on Windows, we have not invested time in making sure the development environment works on Windows without the dev container.

If you want to set up yourself, we recommend using Mise:

$ mise trust
$ mise install
$ uv sync

mise install will automatically install uv, rust, development support tools and the Git pre-commit hooks (managed with hk). You will also need a working C compiler (on macOS, install Xcode or the Xcode command-line tools).

If you want to use a specific Python version, select it with uv venv or uv sync:

$ uv venv -p 3.14t
$ uv sync

If you want all extras, do:

$ uv sync --all-extras

Testing Changes

You should always test your changes by running the LensKit test suite:

uv run pytest tests

If you want to use your changes in a LensKit experiment, you can locally install your modified LensKit into your experiment's environment. We recommend using separate environments for LensKit development and for each experiment; you will need to install the modified LensKit into your experiment's repository:

uv pip install -e /path/to/lkpy

Resources

Acknowledgements

This material is based upon work supported by the National Science Foundation under Grant No. IIS 17-51278. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lenskit-2026.3.0b1.tar.gz (3.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_aarch64.whl (9.5 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

lenskit-2026.3.0b1-cp314-cp314t-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

lenskit-2026.3.0b1-cp312-abi3-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.12+Windows x86-64

lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_x86_64.whl (10.0 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ x86-64

lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_aarch64.whl (9.5 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.28+ ARM64

lenskit-2026.3.0b1-cp312-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

File details

Details for the file lenskit-2026.3.0b1.tar.gz.

File metadata

  • Download URL: lenskit-2026.3.0b1.tar.gz
  • Upload date:
  • Size: 3.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lenskit-2026.3.0b1.tar.gz
Algorithm Hash digest
SHA256 eda7db36b348cca598af37d82fd3ed2b7b1e5da5b838cb5ab2df6e4d7db084ee
MD5 8809600a882b56ccd0e23090c616446d
BLAKE2b-256 95385f62eb2a61deba3a8b8405582a6256a08fdad3968102eb077658aae59a38

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1.tar.gz:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a15cd070ade9b62a5dcec59272c07f5b4898a197c7754f51ae43dc8d98f3ada8
MD5 c3e3234b410afbe9b558e44fcfed5ee7
BLAKE2b-256 3aa49e7b7978126546de3f304f0cc2757d03b9e6aa8891e2b5ba3bfa183cb6c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 19a0fca9a907e56b831abb2cd2a5073dad861103d806dcbce301d943030bb0c2
MD5 b240a5f5620277ae7715c9923af77d63
BLAKE2b-256 0c4a6254f6dcb19675b6fadad5d2e488c47d0814c9cf2e238db6850f9ab62eb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp314-cp314t-manylinux_2_28_aarch64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lenskit-2026.3.0b1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c0c872d54c317fdc9ed81295a13c085e065bfebf2329f0bc168b4c25d9d4a872
MD5 2d65c52bb21d03ad9ef6279e0303b8c5
BLAKE2b-256 b443796b29e52b8d8d99c9ff45f31c3eab7141776c0740cdebbef2044ad8e64e

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: lenskit-2026.3.0b1-cp312-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.4 MB
  • Tags: CPython 3.12+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for lenskit-2026.3.0b1-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4a71415aeb09a712e83c394702dfb11ae2b906fa8a1596c2a8703e5501b7bd33
MD5 0b7b4f84a2ff9e0e019c9196639bf32c
BLAKE2b-256 d1342f1abb966f5c8a9158e0b344de1ba769ab007ca8aee916c0135035695e23

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp312-abi3-win_amd64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a64bc1c146bc1a0b76d05f8e0cb8c0390c85e5ecabfb5688d9c19bb9a90e84d1
MD5 9a23930a92b552426bac1c3eb924c07c
BLAKE2b-256 29fe78ec8edfff0e7133043abce74bf066325486e3704cc190bf9babb88189d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_x86_64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9a57a208b3595ea47a0682fe11ddd94cc6862084afb0880436d4198c3dd1ff27
MD5 2ab75c55e180878f338bd7f4a2e84fdc
BLAKE2b-256 9404a3d247df98f664d7823ba95801ee5c95760eadd740c019d154fe13389891

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp312-abi3-manylinux_2_28_aarch64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lenskit-2026.3.0b1-cp312-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lenskit-2026.3.0b1-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 47b9a39be925db1cd47fa038c8c9e8b732f940ab62f27599546a55f657cb0a5b
MD5 ecd58a0baf15b596a19e10958c10d17e
BLAKE2b-256 f9a876f9106ef74353ce4609347de205836409c6cde7bb0d13e4f2d617981c6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lenskit-2026.3.0b1-cp312-abi3-macosx_11_0_arm64.whl:

Publisher: package.yml on lenskit/lkpy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page