{"id":10134,"library":"pysnmp-lextudio","title":"pysnmp-lextudio","description":"pysnmp-lextudio was a specific distribution or fork of the PySNMP library, providing capabilities for managing network devices via the SNMP (Simple Network Management Protocol). It is now officially deprecated, with its last release (6.3.0) in 2022. Users are strongly advised to migrate to the actively maintained `pysnmp` package for ongoing support, security updates, and compatibility with newer Python versions.","status":"deprecated","version":"6.3.0","language":"en","source_language":"en","source_url":"https://github.com/pysnmp/pysnmp","tags":["snmp","network","deprecated","legacy"],"install":[{"cmd":"pip install pysnmp-lextudio","lang":"bash","label":"Install Deprecated Version"}],"dependencies":[],"imports":[{"note":"Despite the PyPI package name 'pysnmp-lextudio', the internal Python module for all imports is 'pysnmp'.","wrong":"from pysnmp_lextudio.hlapi import SnmpEngine","symbol":"SnmpEngine","correct":"from pysnmp.hlapi import SnmpEngine"}],"quickstart":{"code":"from pysnmp.hlapi import *\nimport os\n\n# IMPORTANT: This package (pysnmp-lextudio) is deprecated.\n# This code is provided for historical context or if you are forced\n# to use this specific deprecated version. For all new projects,\n# you MUST use the actively maintained 'pysnmp' package instead.\n\n# Define SNMP agent parameters\nhostname = os.environ.get('SNMP_AGENT_HOST', 'localhost') # Replace with your SNMP agent's IP/hostname\ncommunity_string = os.environ.get('SNMP_COMMUNITY_STRING', 'public') # Replace with your SNMP community string\nport = int(os.environ.get('SNMP_AGENT_PORT', 161))\n\n# Define the OID to query (e.g., sysDescr.0)\noid = '1.3.6.1.2.1.1.1.0'\n\n# Perform a synchronous GET operation\nerrorIndication, errorStatus, errorIndex, varBinds = next(\n    getCmd(SnmpEngine(),\n           CommunityData(community_string, mpModel=0),\n           UdpTransportTarget((hostname, port)),\n           ContextData(),\n           ObjectType(ObjectIdentity(oid)))\n)\n\nif errorIndication:\n    print(f\"Error: {errorIndication}\")\nelif errorStatus:\n    print(f\"Error: {errorStatus.prettyPrint()} at {errorIndex and varBinds[int(errorIndex) - 1][0] or '?'}\")\nelse:\n    for varBind in varBinds:\n        print(' = '.join([x.prettyPrint() for x in varBind]))\n\n# To run this, you'd typically need an SNMP agent listening on the specified host:port\n# (e.g., snmpd on Linux or a network device with SNMP enabled).","lang":"python","description":"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."},"warnings":[{"fix":"Immediately 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.","message":"The `pysnmp-lextudio` package is officially deprecated and no longer actively maintained. No new features, bug fixes, or security patches will be released.","severity":"breaking","affected_versions":"All versions (6.3.0 and prior)"},{"fix":"Always use `from pysnmp...` for all imports, regardless of the package name used for installation.","message":"The 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`.","severity":"gotcha","affected_versions":"All versions (6.3.0 and prior)"},{"fix":"If 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.","message":"This 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.","severity":"breaking","affected_versions":"All versions (6.3.0 and prior)"},{"fix":"Migrate to `pysnmp` to benefit from updated dependencies and ongoing security maintenance.","message":"While `pysnmp-lextudio` may still be installable, it relies on outdated dependencies that may have known vulnerabilities or compatibility issues with modern systems.","severity":"deprecated","affected_versions":"All versions (6.3.0 and prior)"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Change your import statements from `from pysnmp_lextudio...` to `from pysnmp...`.","cause":"Incorrect import statement. The package is installed as `pysnmp-lextudio`, but the internal module name is `pysnmp`.","error":"ModuleNotFoundError: No module named 'pysnmp_lextudio'"},{"fix":"Verify your Python version (`python --version`). If it's outside 3.8-3.9, you will encounter this. Use a virtual environment with Python 3.8/3.9, or preferably, migrate to the actively maintained `pysnmp` package which supports modern Python versions.","cause":"This error typically occurs if the Python version in your environment is incompatible with the package's requirements. `pysnmp-lextudio` specifically requires Python 3.8-3.9.","error":"ERROR: Could not find a version that satisfies the requirement pysnmp-lextudio (from versions: none)\nERROR: No matching distribution found for pysnmp-lextudio"},{"fix":"Ensure your Python version is exactly 3.8 or 3.9 if you must use `pysnmp-lextudio`. The best fix is to migrate to the `pysnmp` library which is actively maintained and handles string/bytes encoding correctly across supported Python versions.","cause":"This error often indicates code written for Python 2 or older Python 3 versions is interacting with newer Python 3 versions, or an outdated library is being used where string/bytes handling has changed. Given the package's deprecated status and narrow Python support, this is a common symptom of using it in an unsupported Python environment.","error":"TypeError: a bytes-like object is required, not 'str'"}]}