python - 无法在 centos 6.5 上的 python 中导入 netsnmp

标签 python centos net-snmp

我正在尝试在 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/

相关文章:

python - 网格未按预期工作 python Tkinter

python - 将 h5py 数据集输出到文本的快速方法是什么?

java - 创建 .desktop 文件时出现问题,CentOS

centos - 对 iptables 的更改没有效果。我的脚本有什么问题?

linux - OID MIB 值存储在哪里?

python - 如何在 Python 中使用 Google 的文本转语音 API

python - (n,) 在 numpy 和向量的上下文中意味着什么?

php - 尝试安装 mcrypt 扩展时出错

attributes - mib2c - 显示所有变量属性

perl - 如何在实现 net-snmp 代理时清除 perl 脚本错误?