CloudFormation Scripts Erroring About pkg_resources

When launching EC2 instances on AWS, you might need to install and run the CloudFormation helper scripts (https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/releasehistory-aws-cfn-bootstrap.html).

However, since February 2026, as of the latest CloudFormation helper scripts version 2.0-38 (released on 2025-12-04), installing them works fine, but running for example cfn-init causes an error:

ModuleNotFoundError: No module named 'pkg_resources'

The reason is this in the Setuptools 82.0.0 release notes:

v82.0.0

08 Feb 2026

Deprecations and Removals

  • pkg_resources has been removed from Setuptools.

Until AWS fixes the helper scripts to remove the requirement for pkg_resources module, you will need to pin Setuptools to a version lower than 82:

/your/venv/path/bin/pip install "setuptools<82"

Note that pkg_resources had been deprecated for quite a while, for example:

v67.5.0

05 Mar 2023

Changes

  • #3843: Although pkg_resources has been discouraged for use, some projects still consider pkg_resources viable for usage. This change makes it clear that pkg_resources should not be used, emitting a DeprecationWarning when imported.

Updated: February 25, 2026 — 09:26

Leave a Reply