# Chainguard Libraries for Python

URL: https://chainguard-docs-preview-git-fix-learning-lab-jsonld.chainguard.app/software-security/learning-labs/ll202506.md
Last Modified: September 28, 2026
Tags: Learning Labs, Chainguard Libraries, Python

Learning Lab for June 2025 on Chainguard Libraries for Python and Supply Chain Security


The June 2025 Learning Lab with Patrick Smyth covers Chainguard Libraries for
Python. Open source libraries help you move fast, but pulling in external
dependencies can introduce supply chain risk. This session covers fundamental
concepts of Chainguard Libraries, package managers and dependencies, PyPI and
build tools, configuring repository managers, and running example application builds.

[Watch the video on YouTube](https://www.youtube.com/watch?v=h_nzhPY_vDA)


## Sections

- [0:00](https://www.youtube.com/watch?v=h_nzhPY_vDA) Introduction and welcome
- [0:54](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=54s) Patrick Smyth introduction and background
- [1:47](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=107s) Chainguard! Who are we?
- [2:47](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=167s) Chainguard Containers and the "boss assigned me to fix Ubuntu" problem
- [4:12](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=252s) Introduction to Chainguard Libraries for Python
- [5:04](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=304s) Python libraries fundamentals - modules, packages, and libraries
- [6:34](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=394s) The dependency graph problem and modern ecosystem challenges
- [8:57](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=537s) PyPI (Python Package Index) overview and infrastructure
- [10:53](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=653s) Supply chain attacks on the rise and threats to the Python ecosystem
- [11:39](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=699s) Supply chain meme calendar - an attack every month this year
- [13:54](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=834s) Anatomy of supply chain attacks and attack vectors
- [17:43](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1063s) Chainguard Libraries!
- [19:34](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1174s) Chainguard Factory overview and operational security
- [21:33](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1293s) Case study: Ultralytics YOLO December 2024 attack
- [23:22](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1402s) Technical caveats and requirements for Chainguard Libraries
- [25:06](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1506s) Demo introduction and Flask project overview
- [27:48](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1668s) Accessing demo materials on Chainguard Academy
- [29:00](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1740s) Demo: Cloning and setting up the Flask project
- [31:17](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1877s) Demo: Creating virtual environment and installing from PyPI
- [33:06](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=1986s) Demo: Running Flask application and testing with libCheck tool
- [34:28](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2068s) Demo: Configuring pip for Chainguard Libraries via repository manager
- [36:19](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2179s) Demo: Installing dependencies from Chainguard Libraries
- [37:02](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2222s) Demo: Verification with libCheck
- [38:22](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2302s) Demo: Containerizing the demo application
- [40:25](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2425s) Demo: Building and running containerized Flask application
- [41:41](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2501s) Additional configuration options and documentation resources
- [42:19](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2539s) Q&A: Repository manager setup and configuration
- [43:26](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2606s) Q&A: Architecture support and glibc requirements
- [44:34](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2674s) Q&A: libCheck tool open source plans and detailed output
- [46:05](https://www.youtube.com/watch?v=h_nzhPY_vDA&t=2765s) Q&A: CVE scanning with Grype and vulnerability management

## Demo

In the demo, Patrick switches a Flask application to use Chainguard Libraries for Python, sourcing dependencies from a repository manager (Artifactory) set up to pull first from the Chainguard Libraries for Python index with a fallback to the Python Package Index (PyPI).

[Demo Flask application](https://github.com/chainguard-dev/cg-images-python-migration/tree/libraries-demo)

Patrick demonstrates two approaches. First, he modifies the `~/.pip/pip.conf` file to pull from the virtual repository set up in the repository manager:

```
[global]
index-url = <repository-url>
```

After changing this global setting, Patrick installs and runs the application from a virtual environment, then uses Chainguard's `libCheck` tool to test the provenance of the packages in the virtual environment. Chainguard is in the process of releasing this tool under an open source license.

Patrick  also updates the demo application's `requirements.txt` file and build and run the application from a Chainguard Container.

## Resource links

- [Slide deck](/downloads/learning-lab-python-libraries.pdf)
- [Chainguard Libraries](https://www.chainguard.dev/libraries)
- [Chainguard Libraries documentation](/chainguard/libraries/introduction/overview/)
- [Chainguard Libraries for Python documentation](/chainguard/libraries/python/overview/)
- [Python global configuration](/chainguard/libraries/python/global-configuration/)
- [Python build configuration](/chainguard/libraries/python/build-configuration/)
- [Python Package Index (PyPI)](https://pypi.org/)
- [pip documentation](https://pip.pypa.io/)
- [Python Packaging User Guide](https://packaging.python.org/)
- [Cheese Must Stand: Defending the Python Library Ecosystem in 2025 at PyCon 2025](https://www.youtube.com/watch?v=5cdC5pVkCvU)

