Python Package Magic with `uv`
There’s a lot of tools we use when dealing with or setting up Python projects. The basic builtins include `venv`, `pip`, and so on. You’re probably familiar with them all.
But there’s a whole menagerie of tools which, though helpful, never quite solve all the problems you encounter.
Enter `uv` and its magic: it bills itself as a replacement for:
pip
,pip-tools
,pipx
,poetry
,pyenv
,twine
,virtualenv
, and more
And I don’t think they are overselling themselves from my limited experience.
It usually takes awhile to convert me to becoming a tool user, but `uv` just worked out of the box, and was able to do some quick magic that turned me into a believer:
I could select the version of Python I wanted. This helped me experiment with pre-release libraries of lesser known machine learning packages such as PaddlePaddle’s 3.0rc1.
> uv init --python 3.14 test Initialized project `test` at `/Users/wolf/Development/test` > cd test > uv add flask Using CPython 3.14.0a5 Creating virtual environment at: .venv Resolved 9 packages in 431ms Built markupsafe==3.0.2 Prepared 7 packages in 6.15s Installed 7 packages in 3ms + blinker==1.9.0 + click==8.1.8 + flask==3.1.0 + itsdangerous==2.2.0 + jinja2==3.1.6 + markupsafe==3.0.2 + werkzeug==3.1.3
I could run python scripts, snippets, or whole commands with throwaway virtual environments. With whatever version of Python I wanted—even the unreleased 3.14 to get me ready for some conversations at PyCon 2025.
> uvx --python python3.14 pycowsay "Hello, from Python 3.14" ----------------------- < Hello, from Python 3.14 > ----------------------- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
It doesn’t fight the system or make you learn many new things: it has a subcommand that replicates the `pip` interface.
> uv pip install flask Resolved 9 packages in 135ms Installed 9 packages in 8ms + blinker==1.8.2 + click==8.1.8 + flask==3.0.3 + importlib-metadata==8.5.0 + itsdangerous==2.2.0 + jinja2==3.1.6 + markupsafe==2.1.5 + werkzeug==3.0.6 + zipp==3.20.2
It is, truly, blazingly fast. And, yes, they of course they use Rust. How else do you go fast these days? And stay cool?
So, give it a whirl yourself and let me know what you think. I guarantee you’ll be surprised, and a little (or a lot!) happier programming with Python!