Skip to content

What is uv?

Before we start the installation, let's briefly understand uv. uv is an ultra-fast Python package and project manager written in Rust. It's ideal for installing and managing open-source AI projects based on Python.


Preparation: Choose Your Installation Method

We provide two methods to install uv on Windows. You can choose one based on your preference.

  • Method 1: Automatic Installation via PowerShell (Recommended) - This is the easiest and fastest method, completing installation and configuration with a single command.
  • Method 2: Manual Download and Configuration - Choose this method if Method 1 encounters issues or if you want more control over file locations.

PowerShell is a powerful command-line tool built into the Windows system. We will use it to run the official installation script.

Step 1: Open PowerShell

You need to find and open PowerShell.

  1. Click the Start Menu (Windows icon) in the lower-left corner of your screen.
  2. Find the Windows PowerShell folder in the application list, or simply type PowerShell into the search box (Press the Win key + Q, then type powershell to search).

Find in Start Menu

Search for powershell using Win+Q

  1. Click Windows PowerShell to open it. You will see a window with a blue background.

Step 2: Copy and Execute the Installation Command

  1. Use your mouse to completely copy the following command:

    powershell
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
  2. Return to the open PowerShell window, right-click with your mouse, and the copied command will be automatically pasted.

  1. Press the Enter key on your keyboard.

The script will automatically download uv and configure everything for you. During installation, you might see some progress bars and text messages; this is normal.

💡 Command Explanation: This command starts a new PowerShell process, downloads the installation script from the official uv address, and executes it immediately. This method is very safe and won't affect your computer's overall settings.

Step 3: Verify the Installation

After installation, we need to verify if uv was installed successfully. Be sure to open a new PowerShell or CMD window for verification, as environment variable changes require a new window to take effect.

  1. Press the Windows key + R on your keyboard to open the "Run" dialog.

  1. Type cmd and press Enter to open a black Command Prompt window.

  2. In the window, type the following command and press Enter:

    cmd
    uv --version
  3. If you see version information similar to the following, congratulations, the installation was successful! (The version number might differ)

    uv 0.7.19 (38ee6ec80 2025-07-02)


Method 2: Manual Download of the .exe File

If the PowerShell method fails due to network issues or other reasons, you can try manual installation. This process is slightly more complex, but you can complete it by following the steps.

Step 1: Download the uv Program File

  1. Open your browser and visit the uv GitHub releases page: https://github.com/astral-sh/uv/releases

  2. On the page, find the latest release and locate the file named uv-x86_64-pc-windows-msvc.zip to download.

Step 2: Extract and Store the Files

  1. After downloading, find the .zip file, right-click on it, and select "Extract All".
  2. You need to choose a permanent storage location for the extracted files. Please do not leave them in temporary folders like "Downloads" or the Desktop. A good suggestion is to create a dedicated folder in the root directory of your D: or C: drive. For example, let's create a folder named myuv on the D: drive (D:\myuv).
  3. Move the three extracted files — uv.exe, uvx.exe, and uvw.exe — into the D:\myuv folder you just created.

Step 3: Configure System Environment Variables

This is the most critical step. We need to tell the Windows system where to find the uv.exe program.

  1. Find the "This PC" (or "Computer") icon on your desktop, right-click on it, and select "Properties".

  1. In the window that opens, find and click "Advanced system settings".

  2. In the "System Properties" window that pops up, click the "Environment Variables" button at the bottom.

  1. In the "Environment Variables" window, look at the lower section under "System variables", find the variable named Path, click to select it, and then click the "Edit" button.

  1. In the "Edit environment variable" window that pops up, click the "New" button in the upper right.

  1. A new line will appear. Enter the folder path where you stored uv.exe (e.g., D:\myuv). To avoid typing errors, you can also click the "Browse" button and manually navigate to that folder.

  1. After entering the path, click "OK" all the way to close all the settings windows you just opened.

Step 4: Verify the Installation

Just like in Method 1, we need to open a new terminal window to verify.

  1. Press the Windows key + R, type cmd, and press Enter.
  2. In the black Command Prompt window, type uv --version and press Enter.
  3. If the version number is displayed successfully, your manual installation and configuration are complete!


Troubleshooting: Common Issues

Q: I typed uv --version, but it says 'uv' is not recognized as an internal or external command, operable program or batch file. Why?

A: This almost always means failed environment variable configuration or not reopening the terminal window.

  • Check the Path: Carefully repeat Step 3 of Method 2. Ensure the path you added to the Path variable is completely correct and points exactly to the folder containing uv.exe.
  • Restart the Terminal: Changes to environment variables only take effect in command-line windows opened after the change. Be sure to close all open PowerShell or cmd windows and open a new one before trying again.

Q: What should I do if I see red error messages during PowerShell installation?

A: This is usually because your computer's security policy is blocking script execution.

  • Run as Administrator: First, try right-clicking the PowerShell icon and selecting "Run as administrator", then execute the installation command again.
  • Change Execution Policy: If the error persists even in Administrator mode, you can change the execution policy first. In the Administrator mode PowerShell, type the following command and press Enter:
    powershell
    Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

The system will ask for confirmation; type A and press Enter to confirm. This command allows running local scripts and remote scripts from trusted publishers, striking a good balance between security and convenience. After completing this, re-run the uv installation command.