Featured resource
2026 Tech Forecast
2026 Tech Forecast

Stay ahead of what’s next in tech with predictions from 1,500+ business leaders, insiders, and Pluralsight Authors.

Get these insights
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Core Tech
Labs

Guided: First uv Project

In this Code Lab, you will learn to use uv, a fast Python package installer, to set up a project in an offline environment. You'll initialize a virtual environment, install dependencies from local files, manage dependency groups, generate requirements files, verify the setup, and build a comprehensive Python application.

Lab platform
Lab Info
Level
Beginner
Last updated
Nov 20, 2025
Duration
40m

Contact sales

By clicking submit, you agree to our Privacy Policy and Terms of Use.
Table of Contents
  1. Challenge

    Introduction to `uv`

    Welcome to this code lab on uv! uv is a modern, extremely fast Python package installer and resolver written in Rust. It's designed as a drop-in replacement for common tools like pip, pip-tools, and venv.

    In this lab, you'll simulate a common real-world scenario: setting up a project in an environment without internet access. You'll see how uv features make this process straightforward and efficient.

    You'll learn to:

    • Create and manage virtual environments
    • Install dependencies from local sources
    • Work with optional dependency groups
    • Generate requirements files and lock files
    • Verify dependency integrity
    • Build a real-world application

    Begin by exploring the project structure. You have a main.py file for your application code, a pyproject.toml file defining dependencies, and a wheels directory containing pre-downloaded packages. info > This lab experience was developed by the Pluralsight team using Forge, an internally developed AI tool utilizing Gemini technology. All sections were verified by human experts for accuracy prior to publication. For issue reporting, please contact us.

  2. Challenge

    Initializing the Project Environment

    uv can function as a complete toolchain for managing your Python projects. The first step in any project is to create an isolated virtual environment to manage its dependencies separately from other projects on your system. uv simplifies this with the uv venv command, which is significantly faster than Python's built-in python -m venv.

  3. Challenge

    Installing Dependencies Offline

    Managing dependencies is a core task in any project. The pyproject.toml file is the modern standard for defining project metadata and dependencies. Take a look at this project's pyproject.toml to see the packages you need: requests and rich for the core application.

    Because the environment is offline, you can't fetch these from PyPI. uv handles this gracefully with the --find-links flag, which tells it to look for packages in a specified local directory. You'll combine this with --no-index to ensure uv doesn't attempt any network requests. Many projects organize dependencies into groups. Optional dependencies let you install only what you need for specific use cases. For example, development dependencies like testing frameworks are typically separated from production dependencies.

    In this project, the pyproject.toml defines a dev optional dependency group containing pytest for testing. You'll install these optional dependencies next.

  4. Challenge

    Managing Dependencies and Ensuring Reproducibility

    After installing dependencies, it's good practice to generate requirements files and lock files for reproducibility. uv provides several commands for this:

    • uv pip compile – Resolves dependencies from pyproject.toml and generates a requirements.txt file with pinned versions.
    • uv pip freeze – Outputs currently installed packages in a format suitable for a requirements file.
    • uv pip check – Validates that all installed packages are compatible with one another.

    These tools help ensure that your project can be reliably reproduced across different environments.

  5. Challenge

    Developing and Running the Application

    Now for the final step: putting your installed dependencies to use. You will complete a Python script that processes data and displays it in a formatted table. This confirms that the environment is set up correctly and the packages are fully functional.

    Your script will read from a local data.json file, which contains structured data about items. You'll use the requests library to fetch this data (even for local files) and the rich library to create formatted tables and console output.

    This is a more complex application than a simple example. You'll process multiple data items, aggregate information, and present it in a professional format. Testing is an essential part of software development. Now that you have pytest installed as a development dependency, you'll use it to verify that your application works correctly. The project includes test files that validate your implementation.

  6. Challenge

    Conclusion

    Congratulations! You have successfully set up a Python project using uv in a simulated offline environment.

    You've learned how to:

    • Create a virtual environment with uv venv.
    • Install core dependencies from a local source using uv pip sync.
    • Install optional dependency groups using --extra.
    • Generate requirements files with uv pip compile.
    • Create lock files with uv pip freeze.
    • Verify dependency integrity with uv pip check.
    • Run tests with pytest.
    • Build a comprehensive Python application.

    These are the foundational skills you need to adopt uv in your own projects for faster, more reliable dependency management. The offline workflow you've practiced is essential for production environments, air-gapped systems, and CI/CD pipelines where network access may be restricted.

About the author

Tom is a staff author at Pluralsight helping to develop Hands-On content. Tom's background in software development, UI/UX, and instructional design was developed over the years while working as a faculty member at the School of Computing at Weber State University in Utah, and continues to grow as he develops Projects and Labs for Pluralsight. When he's not creating content to allow learners to gain real-life experience, he enjoys spending time with his family.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight