我正在尝试在 python 中使用 netsnmp,但在遵循与 python 中的 netsnmp 相关的所有建议后,它无法导入。我使用以下命令安装了 netsnmp
yum install net-snmp net-snmp-utils
easy_install ipython
snmpd 服务正在运行。 它仍然抛出这个错误
ImportError: No module named netsnmp
我使用的是 Cent os 6.5 和 Python 版本 2.6.6 如果安装不正确或缺少任何其他配置,请提供帮助。
最佳答案
要在 python 中导入 netsnmp,只需要 net-snmp-python ,并且 net-snmp net-snmp-utils 都可以删除。 所以只是
yum install net-snmp-python
可以在 Cent os 6.5 上将 netsnmp 库导入到 python 中
yum install net-snmp net-snmp-utils
将从 Linux 终端启用 SNMP 查询。 两者都可以独立工作。
关于python - 无法在 centos 6.5 上的 python 中导入 netsnmp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23259930/