Skip to main content

uv

Introduction to uv​

uv is a Python package manager designed for managing virtual environments and dependencies. It simplifies the process of creating, managing, and activating Python virtual environments, making it an efficient tool for developers working on multiple projects with different dependencies.

uv is lightweight and easy to use, offering a streamlined alternative to traditional tools like virtualenv and venv. It is particularly useful for managing isolated Python environments in high-performance computing (HPC) systems. For more details, visit the official uv documentation.

Using uv with Modules​

To use uv on the terrabyte HPC system, load the uv module with the following command:

module load uv

Usage Examples​

Once loaded, you can start using uv to manage Python virtual environments. Below are some examples of common uv operations:

Example 1: Create a New Virtual Environment​

To create a new virtual environment named myenv:

uv create myenv

Example 2: Activate a Virtual Environment​

To activate the myenv virtual environment:

uv activate myenv

Example 3: Install a Package in the Virtual Environment​

To install a package, such as numpy, into the active virtual environment:

uv install numpy

Example 4: List Installed Packages​

To list all installed packages in the active virtual environment:

uv list

Example 5: Remove a Virtual Environment​

To remove a virtual environment named myenv:

uv remove myenv

For additional usage instructions and configuration details, refer to the uv documentation.