Python 3.13

ModuleNotFoundError: No module named 'telnetlib'

ModuleNotFoundError: No module named 'telnetlib'

What it means

telnetlib was removed in Python 3.13 (PEP 594, the 'dead batteries' cleanup).

Why it happens

telnetlib was deprecated in 3.11 and removed in 3.13. Code or a dependency still imports it — usually for device/network automation — and breaks after moving to a python3.13 runtime.

How to fix it

  1. Switch to a maintained library such as `telnetlib3` (asyncio-based) or `Exscript`.
  2. Where the device supports it, prefer SSH (`paramiko` / `netmiko`) over Telnet.
  3. Pinning to python3.12 still ships telnetlib, but it postpones rather than removes the dependency; use it only as a tested transition.
  4. Re-test on Python 3.13 after swapping the import.

Related deadline: Lambda Python 3.11 projected create/update restrictions2027-07-31.

Check configured patterns in your project

The free EOLkits scanner processes files in your browser and flags selected related patterns in supported IaC and dependency files. File names and contents are not uploaded; bounded aggregate file and finding counts may be sent. It is not a complete source or AWS-account scan.

Prefer a 10-second check? Paste your config into the free AWS EOL checker. Pasted input is not uploaded; bounded first-party usage events may be sent.

Primary source: https://docs.python.org/3/whatsnew/3.13.html

Inspect the $299 report sample and availability →