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, or from PyPI:
# 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"
# With pip.
$ pip 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.4.27-py3-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d249ca5e5444de4dd4984627bef6f077ffdb45c3ad6b27413ddfb1146daf79b |
|
MD5 | 320abfbf14a1a4b886cbac536d099b00 |
|
BLAKE2b-256 | 073ac593aead3e8e08b7df35120e9c0d4961ea509e27aabc8464e10f80691b4e |
Hashes for uv-0.4.27-py3-none-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1731252da1a71a9f38e5864eb037401340a17eab519ad32e9a9f8fd54b7ada9 |
|
MD5 | cc08a2551364436e0c35c75aa6cd5490 |
|
BLAKE2b-256 | 967f93b2c1dedaed186c6af35a9346173bb8c49a197199d527a3f8bfe356a717 |
Hashes for uv-0.4.27-py3-none-musllinux_1_1_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b05165b0b24573c509286b87825c619658162079e2d3b20fea01d0dd9f444238 |
|
MD5 | c15394a304fb54de414069bcfeadc6ce |
|
BLAKE2b-256 | 131955aa9ad1785805797fe4d7ab9f4bfefc85aa45c2efffea0f583261976b3d |
Hashes for uv-0.4.27-py3-none-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0a5a40f23b61b2c693f6fa6f08b920c7d8b9058ce7ca20f18856844d2f11b2c |
|
MD5 | f5677ad946f98e8a664ed37aab228997 |
|
BLAKE2b-256 | a1b14cdf346b4e07ed375bedeb6429a8c022590c589a5a41d053bc9f059a1fea |
Hashes for uv-0.4.27-py3-none-musllinux_1_1_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb5ced184be4e7611d983462a9f31a24a2e66de60f688ded6a8c36dc701a58ef |
|
MD5 | 0fdf5e74c59f850e7965d034fd8be3bd |
|
BLAKE2b-256 | 1d8b1fa5c0cb2853cb22b003fd43be9bddbfcb2049627609dfece2e696e746dc |
Hashes for uv-0.4.27-py3-none-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b92728ba102ac7284f560c144507961be5aca5263d7a0d70a6896bba7660271c |
|
MD5 | 67cde7b01242ce365ac728e989956e33 |
|
BLAKE2b-256 | 7b6a90bcdce4c34752c41353f480e4adb580b7f08d143557974cf8e72610f9d2 |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7a858209dfaab2527c547836cf823aef5cc1e051c5b15df4ba445a71b252df8 |
|
MD5 | b2ab4e63f3b776c9d8784b16925ebd69 |
|
BLAKE2b-256 | 9340998dd702b768526b78549efa3808676d1e7568e7f8f6d1ea6c4100e10d24 |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bae39264d575d16d5bb3b40699396afb2b27f987d7d7cfe8f336c24d26eda87 |
|
MD5 | a0bd4824b1bd68dad35898156dda7792 |
|
BLAKE2b-256 | 6e079af27653556ee5681ab90d7c813d40d0629a9a473de95a392bb4dbbeafce |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd79e9392af6f41c470f9a95a2f3f8e73cde585eecb2df721f0716cd6134893 |
|
MD5 | b9f409ab9fa3f46844af907f3992d471 |
|
BLAKE2b-256 | 7161dc9448709e42e7414f081fd1e27f1109bbcbbff45ed1cf08b0d1435801d9 |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f552967f4b392f880a1a50d3f57b9372a9666da274ea7826ee14e024ba035f4e |
|
MD5 | 0d9059d90e584ae481adb72510d65f93 |
|
BLAKE2b-256 | a0f23802931beca4fd8127edcd86079bcd3a9d6a78ccd6e761700a0806620006 |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d335e40658a6c23554683410e710e5f54374fec20642e459771f50c8736d600 |
|
MD5 | 7aca2b2fae4c416817f266bb0dfaf238 |
|
BLAKE2b-256 | b2dbef1ed2cb1b74bd66c9ee8243a734b4b20b4590c6e200cfb496601cadb135 |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c5782274a8d3075f4bf82e90c90b0a960abc11424ab353dc559e9329b479681 |
|
MD5 | b94d3f82976c000927a34c6fa991670c |
|
BLAKE2b-256 | ea1eaacd9344b6a6b0a37eb607b1559992c52daee4f40c2a33b1e6413e0bf8ab |
Hashes for uv-0.4.27-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2035efeb39d8d86355d9002e129a76a032a54b47b1332c6952225f48aa9b583c |
|
MD5 | 51e702101e5af7a44291efd88fdaee80 |
|
BLAKE2b-256 | 308998df3c0d7eb3f6b7f785bf42fad39445205c1acaaee98c75412ad019399e |
Hashes for uv-0.4.27-py3-none-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07d693092ad1f2536fec59e1ad5170fab10a214e9d2e39f9cf385cccbf426aa7 |
|
MD5 | c9027169ffb2bb76f7847566479d5677 |
|
BLAKE2b-256 | 9a6e8077a8ffae3c8c1637bc76312af9fc1400e728a66f76ce553529099d9d25 |
Hashes for uv-0.4.27-py3-none-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9e9b8b4062388df4c7a5d1e6c692dc8929242f883e1509010efb2b766ac4edd |
|
MD5 | 3a65995428269b34611582a97e1575b2 |
|
BLAKE2b-256 | 59eb559624239c0f377828d60d27748fdf8b33f061d6171a8e18d92eb254340a |
Hashes for uv-0.4.27-py3-none-linux_armv6l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae4f45a0640de23c880bd5bdb27b1d3a059b45c9f73c2f7d53e392664efeca10 |
|
MD5 | a7fed3769a2f8579554e72cda4f5bb28 |
|
BLAKE2b-256 | a6a0442303fbf0ef393ca8f178979ee18f443b7621d30b30aa0b6f82d68f9b58 |