Where UV Installs System-Wide Packages on Windows 10
When using the UV Python package manager on Windows 10, the location where packages are installed depends on how you invoke UV and whether you are working within a virtual environment or targeting the system Python installation.
Default Behavior: Virtual Environments
By default, UV is venv-first: it creates and manages virtual environments for projects, typically placing the environment in a .venv directory within your project folder. Packages installed using uv add or uv sync are placed inside this local .venv directory, not system-wide[5][8].
System-Wide Installation
If you explicitly want to install packages system-wide (i.e., into the global Python installation available to all users or all projects), you must use the --system flag with the uv pip install command:
code
uv pip install --system <package>
On Windows 10, this will install the package into the site-packages directory of the first Python interpreter found in your system PATH. This is the same location where pip install would place packages when run outside of a virtual environment[6].
Typical System-Wide Package Location on Windows 10
For a standard Python installation, the global site-packages directory is usually located at:
Replace <yourusername> with your Windows username.
Replace PythonXY with your specific Python version, e.g., Python311 for Python 3.11.
If you installed Python from the Microsoft Store or via another method, the path may differ, but it will always be the Lib\site-packages directory under your Python installation root.
UV does not, by default, install packages globally; it encourages the use of isolated environments for dependency management. System-wide installation should be used with caution to avoid dependency conflicts between projects[5][6][8].
References:
[Datacamp UV Guide][5]
[Stack Overflow: uv pip install --system][6]
[SaaS Pegasus UV Deep Dive][8]
User
How can I tell where python is located with UV?
Assistant
How to Find Where Python Is Located with UV
To determine the location of the Python interpreter that UV is using or managing on Windows 10, you can use the following UV commands:
1. List All Installed Python Versions
To see all Python versions that UV can detect (both system and UV-managed), run:
code
uv python list --only-installed
This command will display a list of all installed Python interpreters along with their full paths. For example, you might see output like:
This tells you exactly where each Python executable is located[1][3][2].
2. Find the Active Python Executable
To find the path to the Python executable that UV would use for the current project or environment, run:
code
uv python find
This will print the path to the Python interpreter that matches your current environment or project requirements. If you want to ignore virtual environments and see only system-wide Python installations, use:
code
uv python find --system
This is useful if you want to know which Python interpreter UV will use outside of any virtual environment[2].
3. Additional Details
UV-managed Python installations are typically stored in:
code
C:\Users\<username>\.local\share\uv\python\
Each version is in its own subdirectory, such as cpython-3.12.7-windows-x86_64-none[7][3].
System Python installations (not managed by UV) will appear in their standard install locations, such as:
or wherever you installed Python on your system[2][3].
Summary Table
Command
Purpose
uv python list --only-installed
Lists all detected Python installations with paths
uv python find
Shows the path to the Python UV will use
uv python find --system
Shows the path to the system Python
These commands allow you to quickly and reliably determine where Python is installed and which interpreter UV is using in any context[1][2][3].
User
How would I add an alias like "venv" to trigger ".venv\Scripts\activate" with windows 10 using terminal for windows?
Assistant
Adding a "venv" Alias to Activate .venv\Scripts\activate in Windows 10 Terminal
To create a convenient alias named venv that runs .venv\Scripts\activate in your Windows 10 terminal, you have a few options depending on whether you use Command Prompt (cmd.exe) or PowerShell.
For Command Prompt (cmd.exe)
Using doskey (Temporary Alias)
You can create a temporary alias for the current session with:
code
doskey venv=.venv\Scripts\activate
However, this alias will disappear when you close the terminal[1][3][8].
Making the Alias Persistent
To make the alias available in every new Command Prompt session:
Create a Batch File for Aliases
Create a file, e.g., aliases.cmd, in your user directory or another convenient location.
Add your alias:
code
doskey venv=.venv\Scripts\activate
Register the Batch File to Run on Startup
Open regedit.
Navigate to: HKEY_CURRENT_USER\Software\Microsoft\Command Processor
Add a new String Value named AutoRun with the value set to the full path of your aliases.cmd file[4][8].
Now, every new Command Prompt will load your aliases automatically.
For PowerShell
PowerShell uses a different system for aliases and functions.
Open your PowerShell profile:
code
notepad $PROFILE
If the file doesn't exist, PowerShell will prompt to create it.
Add a function to activate your venv:
powershell
function venv { . .\.venv\Scripts\Activate }
Save and close the file.
Now, typing venv in PowerShell will activate your virtual environment.
For system-wide (all users) persistent variables, use setx /M ... in Command Prompt or "Machine" instead of "User" in PowerShell (requires administrator privileges)[6][7].
Changes made with setx or [Environment]::SetEnvironmentVariable will only be visible in new terminal windows, not the current one[4][5][6].
References:
[1][2][3][4][5][6][7]
Command Prompt
doskey (temporary)
doskey venv=.venv\Scripts\activate
Command Prompt
Persistent alias
Use aliases.cmd + set AutoRun in registry
PowerShell
Profile function
Add function venv { . .\.venv\Scripts\Activate } to $PROFILE
Note:
For project-specific activation, ensure you are in the project directory before running venv.
If you want the alias to work globally, you may need to adjust the path or use a batch file that finds the nearest .venv folder.
References:
[Super User: Set alias in Windows Command Line][1]
[Stack Overflow: Persistent aliases with doskey][4]