What is uv
?
Before we begin the installation, let's briefly understand what uv
is. uv
is an extremely fast Python package and project installer and manager written in Rust. It's perfect for installing and managing Python-based open-source AI projects.
Preparation: Choose Your Installation Method
We offer two methods for installing uv
on Windows. Choose the one that suits your preference.
- Method 1: Automatic Installation using PowerShell (Recommended) - This is the easiest and fastest method, completing the installation and configuration with a single command.
- Method 2: Manual Download and Configuration - Choose this method if you encounter problems with Method 1 or if you want more control over the file location.
Method 1: Automatic Installation using PowerShell (Recommended)
PowerShell is a powerful command-line tool built into Windows. We'll use it to run the official installation script.
Step 1: Open PowerShell
You'll need to find and open PowerShell.
- Click the Start Menu (Windows icon) in the bottom-left corner of your screen.
- Find the
Windows PowerShell
folder in the app list, or directly typePowerShell
in the search box (press Win key + Q, then typepowershell
).
- Click Windows PowerShell to open it. You'll see a window with a blue background.
Step 2: Copy and Execute the Installation Command
Carefully copy the following command:
powershellpowershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Go back to the PowerShell window you just opened, right-click the mouse, and the copied command will be automatically pasted.
- Press the Enter key on your keyboard.
The script will automatically download uv
and configure everything for you. You may see progress bars and text information during the installation, which 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 will not affect your computer's overall settings.
Step 3: Verify the Installation
After the installation is complete, we need to verify that uv
has been installed successfully. Be sure to reopen a new PowerShell or CMD window to perform the verification, as environment variable changes require a new window to take effect.
- Press the Windows key + R key on your keyboard to open the "Run" dialog box.
Enter
cmd
and press Enter to open a black command prompt window.Enter the following command in the window and press Enter:
cmduv --version
If you see version information similar to the following, congratulations, the installation was successful! (The version number may be different)
uv 0.7.19 (38ee6ec80 2025-07-02)
Method 2: Manual Download of EXE File
If the PowerShell
method fails due to network issues or other reasons, you can try manual installation. This process is slightly more complicated, but you can still complete it by following the steps.
Step 1: Download the uv
Program File
Open your browser and visit the
uv
GitHub releases page: https://github.com/astral-sh/uv/releasesFind the latest version on the page and download the file named
uv-x86_64-pc-windows-msvc.zip
.
Step 2: Unzip and Store the File
- After downloading, find the
.zip
archive, right-click on it, and select "Extract All...". - You need to choose a permanent location to store the extracted files. Do not put it in the "Downloads" or a temporary folder on your desktop. A good suggestion is to create a dedicated folder in the D drive or C drive root directory. For example, we create a folder named
myuv
in the D drive (D:\myuv
). - Move the three files
uv.exe
,uvx.exe
,uvw.exe
that you extracted to theD:\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.
- Find the "This PC" (or "Computer") icon on the desktop, right-click it, and select "Properties".
In the window that opens, find and click "Advanced system settings".
In the "System Properties" window that pops up, click the "Environment Variables..." button at the bottom.
- In the lower half of the "Environment Variables" window, find the "System variables" area, then find the variable named
Path
, click on it with the mouse to select it, and then click the "Edit..." button.
- In the "Edit environment variable" window that pops up, click the "New" button in the upper right corner.
- A new line will appear. Enter the folder path where you previously stored
uv.exe
(e.g.,D:\myuv
). To avoid typing errors, you can also click the "Browse..." button and manually find that folder.
- After entering the information, click "OK" all the way to close all the setting windows you just opened.
Step 4: Verify the Installation
As with Method 1, we need to open a new terminal window to verify.
- Press the Windows key + R key on your keyboard, enter
cmd
and press Enter. - In the black command prompt window, enter
uv --version
and press Enter. - If the version number is displayed successfully, it means that your manual installation and configuration are all successful!
Troubleshooting: Common Issues
Q: I entered uv --version
, but it says 'uv' is not recognized as an internal or external command, operable program or batch file.
Why is this?
A: This almost always means that environment variable configuration failed or you did not reopen the terminal window.
- Check the Path: Carefully repeat Step 3 in Method 2, ensuring that the path you added to the
Path
variable is completely correct and is the folder path where you storeduv.exe
. - Restart the Terminal: Modifications to environment variables only take effect for newly opened command-line windows after the modification. Be sure to close all open PowerShell or cmd windows, and then reopen one to try again.
Q: What should I do if I encounter a red error message during PowerShell installation?
A: This is usually because your computer's security policy is blocking the script from running.
- Run as Administrator: First, try right-clicking the PowerShell icon and selecting "Run as administrator", and then execute the installation command again.
- Change Execution Policy: If you still get an error in administrator mode, you can change the execution policy first. In administrator mode PowerShell, enter the following command and press Enter:powershell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
The system will ask you if you want to change it. Enter A
and press Enter to confirm. This command allows you to run local scripts and remote scripts from trusted publishers, which is a good balance of security and convenience. After completion, re-execute the uv
installation command.