- Package:
- python3-pysnmp4
- Source:
- python3-pysnmp4
- Submitter:
- Rik Theys
- Date:
- 2025-11-24 19:55:01 UTC
- Severity:
- normal
Dear Maintainer, *** Reporter, please consider answering these questions, where appropriate *** * What led up to the situation? Upgrade system from bookworm to trixie. * What was the outcome of this action? We use pysnmp in a nagios check. This check started to fail after the upgrade with the following traceback: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/pysnmp/smi/builder.py", line 18, in <module> PY_MAGIC_NUMBER = importlib.util.MAGIC_NUMBER ^^^^^^^^^^^^^^ AttributeError: module 'importlib' has no attribute 'util' It seems the library tries to import importlib.util, but this no longer exists in newer python versions. This seems similar to https://github.com/etingof/pysnmp/issues/451 This seems to make the package unusable. My script is using the pysnmp.hlapi module. Also, the URL of the homepage listed in the package details (http://pysnmp.sourceforge.net/), redirects me to a phishing site. * What outcome did you expect instead? Script keeps working after upgrade *** End of the template - remove these template lines ***
Hi Rik I had similar problems with my script and fixed it by editing
/usr/lib/python3/dist-packages/pysnmp/smi/builder.py
This is just a workaround but might be helpful.
Cheers -- Peppo
*** /usr/lib/python3/dist-packages/pysnmp/smi/builder.py.orig 2019-09-24
18:19:19.000000000 +0200
--- /usr/lib/python3/dist-packages/pysnmp/smi/builder.py 2025-10-09
09:16:56.406215020 +0200
***************
*** 13,18 ****
--- 13,19 ----
try:
import importlib
+ import importlib.util
try:
PY_MAGIC_NUMBER = importlib.util.MAGIC_NUMBER
Hi again My logs just told me that the fix is not sufficient. You also have to import importlib.machinery. Sorry for the hassle -- Peppo ** builder.py.orig 2019-09-24 18:19:19.000000000 +0200 --- builder.py 2025-10-10 08:05:58.140673634 +0200 *************** *** 13,18 **** --- 13,20 ---- try: import importlib + import importlib.util + import importlib.machinery try: PY_MAGIC_NUMBER = importlib.util.MAGIC_NUMBER
Thomas, I see your package for PySNMP 7 has made it into testing. Could you please package it for Trixie too, either as a backport or as a regular update? The package in Trixie is not functional due to this incompatibility with Python 3.13. I think publishing PySNMP 7.x as a Trixie update would be justified, but a backport would be the next best thing. I am keeping servers on Bookworm until version 7 is available in Trixie or, failing that, until Forky becomes stable. I appreciate your work maintaining this important package. Sincerely, Will MacKay Network Engineer Alyrica Networks