Skip to content
Evergreen Evergreen
Documentation

The lib2to3 module was removed in Python 3.13

Removed. The source gives no day. Replacement: libcst or tree-sitter. Source: What’s New in Python 3.13.

Check a version:

evergreen check pkg:generic/python

Python 3.13 removed lib2to3, so importing it raises ModuleNotFoundError; use a maintained parser such as libcst or tree-sitter.

Look up another package or runtime · <form action="../lookup.html" method="get" role="search"> </form>

   
Status Removed
Severity high
Ecosystem python
Component pkg:generic/python
Affected versions vers:pypi/>=3.13
Date from the source The source gives no day
Replacement libcst or tree-sitter
Evidence last seen 2026-10-30
Reviewed 2026-10-30 by arminazimi
Review due 2027-10-30 (365 days after the last review)
Rule ID python.module.lib2to3.removed

Sources

Migration

Constraints

  • Keep the behavior of the code unchanged; check the replacement’s argument and return-value differences.

Steps

  1. Replace the lib2to3 import. Replace each reported import of lib2to3 with libcst or tree-sitter.

Verification

  • python -W error::DeprecationWarning -m pytest: Run the tests with deprecation warnings treated as errors when pytest is used.

Detected by

The python detector. See Detectors and Compatibility.

Other versions of this product

Same ecosystem

Data

This page is generated from registry/python.json, rule python.module.lib2to3.removed, in the ebb.registry.v2 format (how rules are written). A CLE (ECMA-428) export is not published yet. The same facts are embedded in this page as schema.org structured data.

Last updated