An extremely fast Python package and project manager, written in Rust.
Project description
uv
An extremely fast Python package and project manager, written in Rust.
Installing Trio's dependencies with a warm cache.
Highlights
- 🚀 A single tool to replace
pip
,pip-tools
,pipx
,poetry
,pyenv
,twine
,virtualenv
, and more. - ⚡️ 10-100x faster than
pip
. - 🐍 Installs and manages Python versions.
- 🛠️ Runs and installs Python applications.
- ❇️ Runs single-file scripts, with support for inline dependency metadata.
- 🗂️ Provides comprehensive project management, with a universal lockfile.
- 🔩 Includes a pip-compatible interface for a performance boost with a familiar CLI.
- 🏢 Supports Cargo-style workspaces for scalable projects.
- 💾 Disk-space efficient, with a global cache for dependency deduplication.
- ⏬ Installable without Rust or Python via
curl
orpip
. - 🖥️ Supports macOS, Linux, and Windows.
uv is backed by Astral, the creators of Ruff.
Installation
Install uv with our standalone installers:
# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Or, from PyPI:
# With pip.
pip install uv
# Or pipx.
pipx install uv
If installed via the standalone installer, uv can update itself to the latest version:
uv self update
See the installation documentation for details and alternative installation methods.
Documentation
uv's documentation is available at docs.astral.sh/uv.
Additionally, the command line reference documentation can be viewed with uv help
.
Features
Project management
uv manages project dependencies and environments, with support for lockfiles, workspaces, and more,
similar to rye
or poetry
:
$ uv init example
Initialized project `example` at `/home/user/example`
$ cd example
$ uv add ruff
Creating virtual environment at: .venv
Resolved 2 packages in 170ms
Built example @ file:///home/user/example
Prepared 2 packages in 627ms
Installed 2 packages in 1ms
+ example==0.1.0 (from file:///home/user/example)
+ ruff==0.5.4
$ uv run ruff check
All checks passed!
See the project documentation to get started.
uv also supports building and publishing projects, even if they're not managed with uv. See the publish guide to learn more.
Tool management
uv executes and installs command-line tools provided by Python packages, similar to pipx
.
Run a tool in an ephemeral environment using uvx
(an alias for uv tool run
):
$ uvx pycowsay 'hello world!'
Resolved 1 package in 167ms
Installed 1 package in 9ms
+ pycowsay==0.0.0.2
"""
------------
< hello world! >
------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
Install a tool with uv tool install
:
$ uv tool install ruff
Resolved 1 package in 6ms
Installed 1 package in 2ms
+ ruff==0.5.4
Installed 1 executable: ruff
$ ruff --version
ruff 0.5.4
See the tools documentation to get started.
Python management
uv installs Python and allows quickly switching between versions.
Install multiple Python versions:
$ uv python install 3.10 3.11 3.12
Searching for Python versions matching: Python 3.10
Searching for Python versions matching: Python 3.11
Searching for Python versions matching: Python 3.12
Installed 3 versions in 3.42s
+ cpython-3.10.14-macos-aarch64-none
+ cpython-3.11.9-macos-aarch64-none
+ cpython-3.12.4-macos-aarch64-none
Download Python versions as needed:
$ uv venv --python 3.12.0
Using Python 3.12.0
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
$ uv run --python pypy@3.8 -- python --version
Python 3.8.16 (a9dbdca6fc3286b0addd2240f11d97d8e8de187a, Dec 29 2022, 11:45:30)
[PyPy 7.3.11 with GCC Apple LLVM 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>>
Use a specific Python version in the current directory:
$ uv python pin pypy@3.11
Pinned `.python-version` to `pypy@3.11`
See the Python installation documentation to get started.
Script support
uv manages dependencies and environments for single-file scripts.
Create a new script and add inline metadata declaring its dependencies:
$ echo 'import requests; print(requests.get("https://astral.sh"))' > example.py
$ uv add --script example.py requests
Updated `example.py`
Then, run the script in an isolated virtual environment:
$ uv run example.py
Reading inline script metadata from: example.py
Installed 5 packages in 12ms
<Response [200]>
See the scripts documentation to get started.
A pip-compatible interface
uv provides a drop-in replacement for common pip
, pip-tools
, and virtualenv
commands.
uv extends their interfaces with advanced features, such as dependency version overrides, platform-independent resolutions, reproducible resolutions, alternative resolution strategies, and more.
Migrate to uv without changing your existing workflows — and experience a 10-100x speedup — with the
uv pip
interface.
Compile requirements into a platform-independent requirements file:
$ uv pip compile docs/requirements.in \
--universal \
--output-file docs/requirements.txt
Resolved 43 packages in 12ms
Create a virtual environment:
$ uv venv
Using Python 3.12.3
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate
Install the locked requirements:
$ uv pip sync docs/requirements.txt
Resolved 43 packages in 11ms
Installed 43 packages in 208ms
+ babel==2.15.0
+ black==24.4.2
+ certifi==2024.7.4
...
See the pip interface documentation to get started.
Platform support
See uv's platform support document.
Versioning policy
See uv's versioning policy document.
Contributing
We are passionate about supporting contributors of all levels of experience and would love to see you get involved in the project. See the contributing guide to get started.
Acknowledgements
uv's dependency resolver uses PubGrub under the hood. We're grateful to the PubGrub maintainers, especially Jacob Finkelman, for their support.
uv's Git implementation is based on Cargo.
Some of uv's optimizations are inspired by the great work we've seen in pnpm, Orogene, and Bun. We've also learned a lot from Nathaniel J. Smith's Posy and adapted its trampoline for Windows support.
License
uv is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in uv by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for uv-0.5.1-py3-none-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a76765c3cc49268f3c6773bd89a0dacf8a91b040fc3faea6c527ef6f2308eba |
|
MD5 | 578bbfff10442a903bd59ddc0e12c0c7 |
|
BLAKE2b-256 | c50a956467ee8bfa59f698f384eef6e072b14b971d36b7ee6d9b8ed15cfed065 |
Hashes for uv-0.5.1-py3-none-musllinux_1_1_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 821b6a9d591d3e951fbe81c53d32499d11500100d66b1c119e183f3d4a6cd07c |
|
MD5 | 347483d497e077aae0394753484e0e57 |
|
BLAKE2b-256 | fce556d1457ac76bedce375c1adbfebeb281d94a24d35463350c7fc40f9413b8 |
Hashes for uv-0.5.1-py3-none-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4601d40b0c02aff9fb791efa5b6f4c7dbad0970e13ac679aa8fb07365f331354 |
|
MD5 | 9450b49ab4b7d17fa4f8c8e92af00545 |
|
BLAKE2b-256 | 28081ad7ef9ffd0f3c534cbcad47b57afdb785143ec46973faecc5c90de33025 |
Hashes for uv-0.5.1-py3-none-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3db7513c804fb89dcde671ba917cc486cfb574408d6257e19b19ae6b55f5982f |
|
MD5 | 0c383f813265742227247b930a474bfb |
|
BLAKE2b-256 | 110c5ba7bf4b5ca478cf8c9d660d7baa977af1cd3dda2981f20d0c8e436a48f2 |
Hashes for uv-0.5.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01c40f756e9536c05fdf3485c1dfe3da610c3169195bbe20fab03a4c4b7a0d98 |
|
MD5 | 15d9129c3fb2f744fb8fbc068e0cf692 |
|
BLAKE2b-256 | 43801d887496fa3f2853dd670e43da90ee6efa8e020c82e3a1e2b41c19006d9d |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d1ec4a1bc19b523a84fc1bf2a92e9c4d982c831d3da450af71fc3057999d456 |
|
MD5 | c5fd4b2b1b77f66aee3b5063275fead3 |
|
BLAKE2b-256 | be24b2f69c0adb60d4c5d3c5413454ab869ed275db52da4be02eaa9d1a149191 |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72b54a3308e13a81aa2df19baea40611fc344c7556f75d2113f9b9b5a894355e |
|
MD5 | 2c1663ce45325b69f4d0394c0448d62c |
|
BLAKE2b-256 | 511a38edd7edf8fc73d1db87130f4ac62f2381166fabcc36288b63d82e43373c |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac3fce68002e79f3c070f3e7d914e992f205f05af00bfffbe6c44d37aa39c86a |
|
MD5 | 7997e583e651ea60de58aa0ba3749076 |
|
BLAKE2b-256 | 9e65bae32b05056ba6b5441a491ce17c8216ec92cfade62a7b44702758689646 |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaa63053ff6dc4456e2ac2a9b6a8eda0cfaa1e0f861633d9e7315c7df9a0a525 |
|
MD5 | 95bed537f6d2c7c8be1c0609a349d019 |
|
BLAKE2b-256 | eb8c2b3c642d71f18eff826a74329b23a269f2962b52d251854b645c98121e15 |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8dce5b6d6dea41db71fe8d9895167cc5abf3e7b28c016174b1b9a9aecb74d483 |
|
MD5 | 42d8b05b7188336d635f6f663183c145 |
|
BLAKE2b-256 | 0f810c08c94a9c9f27adc11fd9c3f55d6244c3066cbdea1a9c636fcc1bf45d53 |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73853b98bce9e118cda2d64360ddd7e0f79e237aca8cd2f28b6d5679400b239e |
|
MD5 | decae2f1cc8178b242456e6acbb8d103 |
|
BLAKE2b-256 | 86fc74a2fbfb9fc5c1772c0f85718da3e79a05aa3bdd5db1d83851f33e119e01 |
Hashes for uv-0.5.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6ec61220d883751777cbabf0b076607cfbdeb812bc52c28722e897271461e589 |
|
MD5 | 2ae453a3a8d3087c28f11640b5c54cf6 |
|
BLAKE2b-256 | 88f1244f0f5e0afdc86de3c12c62c51f594a8b900d8ae1bf7cc64d9d92147199 |
Hashes for uv-0.5.1-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d209164448c8529e21aca4ef1e3da94303b1bf726924786feffd87ed93ab4a |
|
MD5 | 061b8101a3f1480c2057949ba9a6d087 |
|
BLAKE2b-256 | a7ef375bb00fa3e73cbb29ffd1d2a0cea3a52b4c0e67f68bce646a9ed0539f18 |
Hashes for uv-0.5.1-py3-none-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f66859e67d10ffff8b17c67c7ede207d67487cef20c3d17bc427b690f9dff795 |
|
MD5 | 3767a7afcf514ea2d2ee56bcf04a8a7a |
|
BLAKE2b-256 | 6b23f0f8234624f720b5a856800d85a2220405182cfd798eefbda8b7868f9c4d |
Hashes for uv-0.5.1-py3-none-linux_armv6l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93f0a02ea9149f4e7e359ef92da6f221da2ecf458cda2af729a1f6fa8c3ed1d2 |
|
MD5 | 126ed96f66d2ccb0a56a331b94cf1772 |
|
BLAKE2b-256 | ba339183528527cb8532369b678e1d12fb97e3777fed875f1d7ea6c75c570f64 |