Python has a messy ecosystem of tools, which has always bothered me.
I’m a big fan of simplicity and minimalistic setups, so when I’m presented with so many options like: pip, pipenv, poetry, conda, virtualenv, venv, pyenv and the whole shebang, I get overwhelmed.
I was using poetry with pyenv for a while, but I still found it to be too heavy. I wanted something that was lightweight, easy to use, and had a small learning curve. Then I stumbled upon uv, which has everything I was looking for, plus is fast and simple to use.
What is uv?
Is basically all the tools mentioned above combined into one. It handles virtual environments, dependency management, package installation, and other stuff in a single tool. It’s designed to be simple and intuitive, so it will be easy for you to get started quickly.
INFO
Fun fact: The maintainers for
uvare the same folks behindruff, which I also use and love. I really admire when companies like these build useful open source tools for the community, so kudos to them.
Cheat sheet
Installation and getting started is super easy:
# Install uv
brew install uv
# Create a new project
uv init my_project
# Add dependencies
uv add requests numpy
# Install dependencies
uv sync
# Run your project
uv run main.py
TIP
Another cool feature is that
uvautomatically creates and manages virtual environments for your projects, so you don’t have to worry about setting them up manually.
You can also use uv to manage Python versions and switch between them:
# Install a specific Python version
uv python install 3.10.0
# Pin a Python version for your project
uv python pin 3.10.0
To install tools like ruff or black, you can use:
# Add development dependencies
uv tool install ruff black
# Run a tool
uvx ruff check .