Why UV?
UV is very fast as compared to pip. It has been written in Rust, a systems programming language known for performance and safety. Where pip takes seconds (or minutes) to resolve dependencies, UV does it in milliseconds.
UV resolves and installs packages 10-100x faster than pip
💡 What UV Replaces
UV replaces multiple tools in your Python workflow: pip (installing packages), virtualenv/venv (creating environments), pyenv (managing Python versions), and pip-tools (dependency resolution). One tool. Everything.
Installation
Choose your operating system:
Install UV on Windows
Using PowerShell (recommended):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Or using pip (if you already have Python):
pip install uv
Using WinGet:
winget install --id=astral-sh.uv -e
Install UV on macOS
Using Homebrew (recommended):
brew install uv
Using the install script:
curl -LsSf https://astral.sh/uv/install.sh | sh
Or using pip:
pip install uv
Install UV on Linux
Using the install script (works on most distros):
curl -LsSf https://astral.sh/uv/install.sh | sh
For specific distros:
# Ubuntu/Debian (via apt - coming soon)
# For now, use the install script above
# Arch Linux
yay -S uv-bin
# Or using pip
pip install uv
Verify Installation
Check that UV is installed correctly:
uv --version
1. List Available Python Versions
See all Python versions UV can install for you:
uv python list
2. Create a Virtual Environment
Create an isolated environment with a specific Python version:
uv venv myenv --python 3.12
3.12) comes from the uv python list command above. UV will automatically download that version if you don't have it.
Activate the environment:
# Windows
myenv\Scripts\activate
# macOS / Linux
source myenv/bin/activate
3. Start a New Project
Initialize a new project with UV (creates pyproject.toml):
uv init my-project
This creates a modern Python project structure with pyproject.toml ready to go.
4. Install Packages
Install any library — UV handles dependencies in milliseconds:
uv pip install python-dotenv
Install multiple packages at once:
uv pip install langchain langchain-openai python-dotenv
5. Install from Requirements File
Install everything from your requirements.txt:
uv pip install -r requirements.txt
Generate a requirements file from your current environment:
uv pip freeze > requirements.txt
6. Run Python Scripts
Run any Python script with UV — it automatically uses the correct environment:
uv run python my_script.py
✅ UV vs Pip: Quick Reference
pip install package → uv pip install package
pip install -r requirements.txt → uv pip install -r requirements.txt
python -m venv env → uv venv env
pyenv install 3.12 → uv python install 3.12
pip freeze → uv pip freeze
Next Steps
Use UV with your LangChain projects:
- Simple LangChain LLMChain — Build a prompt → model → parser pipeline
- Save & Load Config — Serialize prompts and LLM configs to JSON
- RAG Pipeline — Build a document Q&A system with FAISS
🚀 Speed Up Your Python Workflow?
I help teams modernize their Python tooling with UV, Docker, and CI/CD pipelines.
Let's Talk