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 3.12 is itself on the Lambda deprecation track — treat it as a stopgap only.
  4. Re-test on Python 3.13 after swapping the import.

Related deadline: Lambda Python 3.11 EOL2027-07-31.

Find every instance in your project

The free EOLkits scanner runs in your browser (nothing uploaded) and flags this and related breakages across your IaC and dependency files.

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

Get the full migration audit — $299, hash-anchored PDF →