0% found this document useful (0 votes)
54 views1 page

UV Demo

The document details the process of creating and managing a virtual environment using the 'uv' command-line tool. It includes steps for activating the environment, adding packages like numpy and pandas, running a Python script, and handling requirements from a file. Additionally, it shows commands for syncing and locking package dependencies within the virtual environment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views1 page

UV Demo

The document details the process of creating and managing a virtual environment using the 'uv' command-line tool. It includes steps for activating the environment, adding packages like numpy and pandas, running a Python script, and handling requirements from a file. Additionally, it shows commands for syncing and locking package dependencies within the virtual environment.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv venv

Using CPython 3.12.7 interpreter at: C:\Users\ermub\anaconda3\python.exe


Creating virtual environment at: .venv
Activate with: .venv\Scripts\activate
PS C:\Users\ermub\Python UV Demo Project\uvdemo> .venv\Scripts\activate
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv

(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv add numppy


⠋ Resolving dependencies...
× No solution found when resolving dependencies:
╰─▶ Because numppy was not found in the package registry and your
project depends on numppy, we can conclude that your project's
requirements are unsatisfiable.
help: If you want to add the package regardless of the failed
resolution, provide the `--frozen` flag to skip locking and
syncing.
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv add numpy
Resolved 2 packages in 803ms
Prepared 1 package in 20.96s
Installed 1 package in 588ms
+ numpy==2.2.5
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv add pandas

Resolved 7 packages in 1.36s


Prepared 5 packages in 12.52s
Installed 5 packages in 804ms
+ pandas==2.2.3
+ python-dateutil==2.9.0.post0
+ pytz==2025.2
+ six==1.17.0
+ tzdata==2025.2
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv run main.py
Hello from uvdemo!
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv add -r
requirements.txt
error: File not found: `requirements.txt`
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv add -r
requirements.txt
Resolved 7 packages in 3ms
Audited 6 packages in 0.04ms
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv run main.py
Hello from uvdemo!
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv sync
Resolved 7 packages in 3ms
Audited 6 packages in 0.05ms
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo> uv lock
Resolved 7 packages in 3ms
(uvdemo) PS C:\Users\ermub\Python UV Demo Project\uvdemo>

You might also like