Python UV Tutorial: A Faster Replacement for Pip, Virtualenvs, & Poetry
About this lesson
@MattMacarty Is it time to replace pip? In this tutorial, I'll show you how to get started with uv—an incredibly fast, all-in-one replacement for pip, virtualenv, poetry, and python version managers. Built by Astral, uv installs packages orders of magnitude faster and streamlines the mundane tasks of starting new Python projects. Best of all? You don't even need Python installed on your machine to set it up! Learn how to use the UV python package manager to speed up your workflow. I will show you how to set up projects and manage dependencies faster. If you are tired of slow installations with PIP, this guide covers how to get started with UV as a modern alternative. We look at initializing new projects, configuring your pyproject.toml file, and handling Python versions efficiently. This walkthrough is designed for Python developers who need a reliable way to manage virtual environments without the usual wait times. By the end of this video, you will have a clear understanding of how to initialize a project and maintain your dependencies using this tool. We also cover the basics of running your project once the setup is complete. Using the UV python package manager correctly can save you significant time on every new build. 🚀 What we cover in this video: * 00:00 - Why you should upgrade from PIP to UV * 00:14 - How to install UV via command line (Windows, Mac, & Linux) * 01:04 - Verifying your installation & updating UV (`uv self update`) * 01:21 - Initializing a new project (`uv init`) and setting up Python versions * 02:49 - Running scripts smoothly without manual environment activation (`uv run`) * 03:52 - Creating package & library layouts (`--lib` and `--package` flags) * 04:22 - Adding dependencies (`uv add`) and exploring the lightning-fast cache * 05:07 - Managing `pyproject.toml` vs. lockfiles and syncing environments (`uv sync`) * 06:02 - Managing your local cache (`uv cache dir` & `uv cache clean`) * 06:40 - Using UV as a Python version manager (
DeepCamp AI