Skip to main content

LanceDB Python SDK

A Python library for LanceDB.

Installation

pip install lancedb

Pre-Haswell x86_64 hosts: lancedb-compat

The default lancedb wheel targets x86-64-haswell (AVX2 + FMA + F16C) for full performance on modern hardware. Pre-Haswell hosts — Intel Sandy Bridge / Ivy Bridge / Westmere; AMD Bulldozer / Piledriver / Steamroller — don't have AVX2 and crash with Illegal instruction at import lancedb.

For those hosts, install the lancedb-compat package instead:

pip install lancedb-compat

Same Python API (import lancedb works as usual). The compat wheel is compiled at the x86-64-v2 baseline (Nehalem-class) and uses runtime SIMD dispatch in the embedded lance crate to pick the right kernel tier (scalar / AVX / AVX+FMA / AVX2+FMA / AVX-512) at load time, so it still goes fast on modern hardware while running cleanly on the pre-Haswell silicon. Use lance.simd_info() from Python to verify which tier was selected.

lancedb and lancedb-compat install to the same lancedb/ namespace and conflict at install time. Pick one. To switch, pip uninstall lancedb first, then pip install lancedb-compat (or vice-versa).

If you need a custom baseline (or lancedb-compat isn't yet published for your platform), build from source with the override:

RUSTFLAGS="-C target-cpu=x86-64-v2" maturin build --release
pip install ./target/wheels/lancedb-*.whl

Preview Releases

Stable releases are created about every 2 weeks. For the latest features and bug fixes, you can install the preview release. These releases receive the same level of testing as stable releases, but are not guaranteed to be available for more than 6 months after they are released. Once your application is stable, we recommend switching to stable releases.

pip install --pre --extra-index-url https://pypi.fury.io/lancedb/ lancedb

Threading in CPU-limited containers

LanceDB uses separate pools for compute work and storage I/O. On a container with two visible CPUs, current releases intentionally use one compute worker by default; no manual configuration is needed. If every query logs an I/O core reservation warning on a two-CPU container, upgrade from LanceDB 0.21.1 or earlier.

The two commonly tuned environment variables control different resources:

  • LANCE_CPU_THREADS overrides the number of compute workers. One worker is the appropriate setting for a two-CPU container when an explicit override is needed.
  • LANCE_IO_THREADS controls concurrent storage operations, not reserved CPU cores. Its default can be greater than the number of CPUs because I/O workers spend much of their time waiting for storage.

Keep the defaults unless measurements show that the workload benefits from an override. See the Lance threading model for the current defaults and tuning guidance.

Usage

Basic Example

import lancedb
db = lancedb.connect('<PATH_TO_LANCEDB_DATASET>')
table = db.open_table('my_table')
results = table.search([0.1, 0.3]).limit(20).to_list()
print(results)

Development

See CONTRIBUTING.md for information on how to contribute to LanceDB.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

lancedb-0.38.0-cp310-abi3-win_amd64.whl (104.1 MB view details)

Uploaded CPython 3.10+Windows x86-64

lancedb-0.38.0-cp310-abi3-manylinux_2_28_x86_64.whl (67.7 MB view details)

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

lancedb-0.38.0-cp310-abi3-manylinux_2_28_aarch64.whl (64.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

lancedb-0.38.0-cp310-abi3-macosx_11_0_arm64.whl (60.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file lancedb-0.38.0-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: lancedb-0.38.0-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 104.1 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for lancedb-0.38.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6e99b98c10ebfb68f36fff5d159246ce4ef5ee686d49c9298a3fc88f754a470d
MD5 1ed9fbd41e5ac46492c8583433c56c78
BLAKE2b-256 0f4da1e7febf279c15afdf8102d9458b5457be02b2173a17d2a472f83f9034a6

See more details on using hashes here.

File details

Details for the file lancedb-0.38.0-cp310-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for lancedb-0.38.0-cp310-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2b20ce0a865f386e5460736c058a4baae6c618072436a55119b5b5052a655749
MD5 e3c6f2e0be9c31ac46f60df3f39cac9e
BLAKE2b-256 cfcf3df2396facdba00b787abf0cbcfb05ad3c0d27b86e2a5eca1deb675fe54f

See more details on using hashes here.

File details

Details for the file lancedb-0.38.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for lancedb-0.38.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b80362e1335e8fb71ece2d5c0665dd603af1f6715696fcc652a7053039b6a085
MD5 20377e3eb384e55e2f41053e54ce3502
BLAKE2b-256 a4cbfd9ac855ad4c4a7503e8c98133916dde30edb5a74ea04ea3da246ed0192a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lancedb-0.38.0-cp310-abi3-manylinux_2_28_aarch64.whl:

Publisher: pypi-publish.yml on lancedb/lancedb

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

File details

Details for the file lancedb-0.38.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for lancedb-0.38.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1559fa168fad17f5f67d6e072f7daa3cba3c7f66b82ef6cf4cf75a8e0a79c888
MD5 97cde4a112b480521bab7ac3a533ba9e
BLAKE2b-256 85e5556c3d9871231aa94e309293bac8bc24fe43f5965e0e294c82fc1cdc3d3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lancedb-0.38.0-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: pypi-publish.yml on lancedb/lancedb

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

Release history Release notifications | RSS feed

This release

0.38.0 This release

4 files

0.37.1

4 files

0.36.0

4 files

0.34.0

4 files

0.33.0

6 files

0.32.0

6 files

0.30.2

6 files

0.30.1

4 files

0.30.0

6 files

0.29.2

6 files

0.29.1

6 files

0.29.0

6 files

0.27.1

6 files

0.27.0

6 files

0.26.1

6 files

0.26.0

6 files

0.25.3

7 files

0.25.2

7 files

0.25.1

7 files

0.25.0

7 files

0.24.3

7 files

0.24.2

7 files

0.24.1

7 files

0.24.0

7 files

0.23.0

7 files

0.22.1

7 files

0.22.0

7 files

0.21.2

7 files

0.21.1

7 files

0.21.0

7 files

0.20.0

7 files

0.19.0

7 files

0.18.0

6 files

0.17.1

6 files

0.17.0

6 files

0.16.0

6 files

0.15.0

6 files

0.14.0

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page