Install & Compatibility
Where this runs
tested against v6.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 58MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 5.4s · import 0.000s · 58MB
58MB installed
● package 58MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SnmpEngine
✓ from pysnmp.hlapi import SnmpEngine
✗ from pysnmp_lextudio.hlapi import SnmpEngine
Despite the PyPI package name 'pysnmp-lextudio', the internal Python module for all imports is 'pysnmp'.
This quickstart demonstrates a basic SNMP GET operation using pysnmp-lextudio. It attempts to retrieve the 'sysDescr.0' OID (system description). Note the prominent warning that this package is deprecated and migration to `pysnmp` is highly recommended.
from pysnmp.hlapi import *
import os
# IMPORTANT: This package (pysnmp-lextudio) is deprecated.
# This code is provided for historical context or if you are forced
# to use this specific deprecated version. For all new projects,
# you MUST use the actively maintained 'pysnmp' package instead.
# Define SNMP agent parameters
hostname = os.environ.get('SNMP_AGENT_HOST', 'localhost') # Replace with your SNMP agent's IP/hostname
community_string = os.environ.get('SNMP_COMMUNITY_STRING', 'public') # Replace with your SNMP community string
port = int(os.environ.get('SNMP_AGENT_PORT', 161))
# Define the OID to query (e.g., sysDescr.0)
oid = '1.3.6.1.2.1.1.1.0'
# Perform a synchronous GET operation
errorIndication, errorStatus, errorIndex, varBinds = next(
getCmd(SnmpEngine(),
CommunityData(community_string, mpModel=0),
UdpTransportTarget((hostname, port)),
ContextData(),
ObjectType(ObjectIdentity(oid)))
)
if errorIndication:
print(f"Error: {errorIndication}")
elif errorStatus:
print(f"Error: {errorStatus.prettyPrint()} at {errorIndex and varBinds[int(errorIndex) - 1][0] or '?'}")
else:
for varBind in varBinds:
print(' = '.join([x.prettyPrint() for x in varBind]))
# To run this, you'd typically need an SNMP agent listening on the specified host:port
# (e.g., snmpd on Linux or a network device with SNMP enabled).
Debug
Known issues
breakingThe `pysnmp-lextudio` package is officially deprecated and no longer actively maintained. No new features, bug fixes, or security patches will be released.fixImmediately migrate to the actively maintained `pysnmp` package by uninstalling `pysnmp-lextudio` and installing `pysnmp` (`pip uninstall pysnmp-lextudio && pip install pysnmp`). Review import paths and API compatibility.
affects: All versions (6.3.0 and prior)
gotchaThe PyPI package name (`pysnmp-lextudio`) differs from the internal Python module name used for imports (`pysnmp`). Attempting to import `pysnmp_lextudio` will result in a `ModuleNotFoundError`.fixAlways use `from pysnmp...` for all imports, regardless of the package name used for installation.
affects: All versions (6.3.0 and prior)
breakingThis package is only officially compatible with Python versions 3.8 and 3.9. It is not supported on Python 3.10+ or Python 4, and may cause installation issues or runtime errors on newer interpreters.fixIf you must use this deprecated package, ensure your environment runs Python 3.8 or 3.9. The recommended fix is to migrate to `pysnmp`, which actively supports newer Python versions.
affects: All versions (6.3.0 and prior)
deprecatedWhile `pysnmp-lextudio` may still be installable, it relies on outdated dependencies that may have known vulnerabilities or compatibility issues with modern systems.fixMigrate to `pysnmp` to benefit from updated dependencies and ongoing security maintenance.
affects: All versions (6.3.0 and prior)
Upgrade
Version history
6.3.0latest on PyPI · released Oct 6, 2024
Audit
Dependencies
No dependency data recorded yet.