Overview
This guide helps you migrate from pip-based dependency management to uv. The migration is backward compatible - both methods work, but uv is now the recommended approach.Why Migrate?
Performance
- ⚡ 10-100x faster dependency resolution
- 🚀 Parallel downloads and installations
- 📦 Efficient caching with automatic deduplication
Reliability
- 🔒 Reproducible builds via
uv.locklockfile - 🛡️ Better conflict resolution than pip
- ✅ Deterministic dependency trees
Developer Experience
- 🎯 Single command:
uv syncreplaces multiple pip commands - 🔧 Automatic venv management - no manual activation
- 📝 Single source of truth - pyproject.toml only
Quick Migration
For Developers
Before (pip):For CI/CD
Before (pip):Detailed Migration Steps
Step 1: Install uv
- macOS/Linux
- Windows
- Via pip
Step 2: Remove Old Virtual Environment (Optional)
Step 3: Install Dependencies with uv
- ✅ Creates
.venvif it doesn’t exist - ✅ Reads
pyproject.tomlfor dependencies - ✅ Uses
uv.lockfor exact versions - ✅ Installs everything in one fast operation
Step 4: Update Your Workflow
Replace old commands with new ones:| Old Command | New Command | Notes |
|---|---|---|
pip install -r requirements.txt | uv sync | Installs all deps |
pip install -e . | uv sync | Editable install included |
python script.py | uv run python script.py | Auto-activates venv |
pytest | uv run pytest | No activation needed |
pip install black | uv tool install black | For standalone tools |
Step 5: Update Scripts & Makefiles
Before:Common Workflows
Development Workflow
Adding New Dependencies
Before (pip):Updating Dependencies
Installing Optional Dependencies
CI/CD Migration
GitHub Actions
Before:Docker
Current approach (still works):Troubleshooting
Issue: “uv: command not found”
Solution:Issue: Dependencies not found
Solution:Issue: Version conflicts
Solution:Issue: “No module named X” when running code
Solution:Issue: CI/CD cache issues
Solution:FAQ
Do I need to delete requirements.txt files?
No. They’re kept for backward compatibility and will be removed in a future release.Can I still use pip?
Yes. You can still runpip install -e . if needed, but uv is recommended.
What about requirements-pinned.txt?
uv.lock replaces it. The lockfile provides the same guarantees with better performance.How do I know which Python version to use?
Check.python-version file:
Can I use uv with existing venv?
Yes, but starting fresh is recommended:Does uv work on Windows?
Yes. uv supports Windows, macOS, and Linux.What if I need a specific version?
Editpyproject.toml:
Migration Checklist
- Install uv (
curl -LsSf https://astral.sh/uv/install.sh | sh) - Verify uv works (
uv --version) - Run
uv syncto install dependencies - Test your application (
uv run python -m <your_module>) - Run tests (
uv run pytest) - Update scripts/Makefiles to use uv
- Update CI/CD workflows (if applicable)
- Update documentation (if applicable)
- Delete old
.venvif you want a fresh start
Getting Help
Documentation
- uv docs: https://github.com/astral-sh/uv
- This project’s docs: Installation Guide
Issues
- uv issues: https://github.com/astral-sh/uv/issues
- Project issues: https://github.com/vishnu2kmohan/mcp-server-langgraph/issues
Community
Rollback Plan
If you need to revert to pip:Benefits Recap
- ✅ 10-100x faster dependency resolution
- ✅ Reproducible builds with lockfile
- ✅ Single command for everything
- ✅ Automatic venv management
- ✅ Better caching and performance
- ✅ Modern Python packaging (PEP 621)
- ✅ Works everywhere - Windows, macOS, Linux
Questions? Open an issue or check our discussions.