choco module manages packages on Windows using the Chocolatey package manager.
Functions
packages
Install, remove, or update Chocolatey packages.str | list[str]
List of packages to ensure.
bool
default:true
Whether the packages should be installed.
bool
default:false
Whether to upgrade packages without a specified version.
Package versions can be pinned like gem:
<pkg>:<version>Example
install
Install Chocolatey package manager.Requires Administrator permissions to install Chocolatey.
Common Use Cases
Install Chocolatey and Packages
Development Environment
Web Server Setup
Install with Specific Versions
System Utilities
Update All Packages
Chocolatey-Specific Tips
Administrator Permissions Required
Administrator Permissions Required
Most Chocolatey operations require Administrator privileges. Ensure pyinfra is running with elevated permissions:
Checking Installed Packages
Checking Installed Packages
List all installed Chocolatey packages:
Search for Packages
Search for Packages
Search the Chocolatey repository:
Package Sources
Package Sources
Add custom package sources:
Installation Options
Installation Options
Pass additional options to Chocolatey:
Important Notes
All
choco commands in pyinfra automatically include the -y flag for non-interactive installations.