--- title: uv โ€” ultra-fast Python package manager date: 2026-10-18 time: 12:00 model: admin category: programs author_type: human summary: A Python package management and execution tool made with Rust. It is dozens of times faster than pip. tags: program, Modern CLI Tools, uv --- **๐Ÿ’ฌ "uv command"** uv is a **ultra-fast Python package manager**, a Python package management and execution tool built with Rust. It is dozens of times faster than pip. As it is built on Rust, it provides 10~100x faster installation compared to pip. It includes built-in virtual environment creation and management (virtualenv is not required). - **Concept**: Being built on Rust, it offers installation 10~100x faster than pip. - **Key Features**: Includes built-in virtual environment creation and management (virtualenv is not required). - **Advantages**: Pins dependencies with pyproject.toml and uv.lock. - **Usage**: Also downloads and manages Python itself (replacing pyenv). ## Installation and Download uv is installed via a package manager or an official script. | Environment | Command | | --- | --- | | Official Script (Linux/macOS) | curl -LsSf https://astral.sh/uv/install.sh | sh | | macOS (brew) | brew install uv | | pip (legacy) | pip install uv | | Rust cargo | cargo install uv | | Verify | uv --version | You can verify the installation with `uv --version`. ## Common Options | Option | Description | | --- | --- | | uv init | Initialize a new project | | uv add | Add a dependency and update the lock file | | uv run | Run a command inside the virtual environment | | uv venv | Create a virtual environment | | uv pip install | A pip-compatible install command | ## Essential Command Combination 3 - `uv init myapp && cd myapp` โ€” Initialize a new project - `uv add fastapi uvicorn` โ€” Add dependencies - `uv run python main.py` โ€” Execute in the virtual environment **๐Ÿ’ฌ "Show me an example of using uv on a real server."** Here are common situations encountered on production servers, presented in order. ### Step 1 ยท Verify Installation Check if it is installed. ``` uv --version || curl -LsSf https://astral.sh/uv/install.sh | sh ``` ### Step 2 ยท Create Virtual Environment Create the project's virtual environment. ``` cd /var/www/app && uv venv ``` ### Step 3 ยท Install Dependencies Install the existing requirements.txt. ``` uv pip install -r requirements.txt ``` ## Actual Execution Screen This shows the result of creating a virtual environment and installing dependencies using uv. ![uv command execution result](https://games.aidebatehub.com/assets/uv-demo.png) A production server ## How It's Used in Practice ### 1. Migrating an Existing pip Project **Scenario** โ€” Migrating an existing requirements.txt to uv. ``` uv venv && uv pip install -r requirements.txt ``` **Result** โ€” 24 packages are installed in 120ms. **Key Point** โ€” Build time is reduced from tens of seconds to tens of milliseconds. ### 2. Ensuring Reproducibility in CI **Scenario** โ€” Introducing uv into the CI pipeline. ``` uv add fastapi && uv run pytest ``` **Result** โ€” Reproducible installation is possible with uv.lock. **Key Point** โ€” The uv.lock file must always be committed to git. ## Actual Execution Screen This shows the result of running an application with uv run. ![uv command execution result 2](https://games.aidebatehub.com/assets/uv-demo2.png) A production server ## Points to Note - The uv.lock file must always be committed to git. Without it, reproducibility is lost. - To avoid conflicts with globally installed packages from pip, use it only inside a virtual environment. - In corporate firewall environments, setting a PyPI mirror (--index-url) may be necessary. --- Source (HTML): https://games.aidebatehub.com/programs/linux/modern/uv.html This file is an auto-generated Markdown twin of the DevHub document.