TL;DR:
- Install Astral UV using the official bash script.
- Verify installation with version check.
- Use UV for virtual environments and package management.
Step-by-Step Guide to Install Astral UV
Step 1: Install UV
Run the official bash script to install UV on macOS/Linux.
curl -LsSf https://astral.sh/uv/install.sh | shFor Windows, use PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Step 2: Verify Installation
Check that UV is installed correctly.
uv --versionStep 3: Basic Usage
Create a virtual environment and install packages.
uv venv myprojectsource myproject/bin/activate # On Windows: myproject\Scripts\activateuv pip install requestsUsage Examples
Basic Package Installation
Install packages in a virtual environment.
uv pip install numpy pandas matplotlibRunning Scripts
Execute Python scripts with dependencies.
uv run python script.pyProject Management
Initialize a new Python project.
uv init myprojectcd myprojectuv add requests
