提前感谢您的帮助。
这是一个问题,我将模块 pysnmp 与 pyasn1 一起使用,我正在使用此示例: http ://pysnmp.sourceforge.net/quickstart.html ,并收到错误消息:
# python snmp.py
Traceback (most recent call last):
File "snmp.py", line 1, in <module>
from pysnmp.entity.rfc3413.oneliner import cmdgen
File "/home/user_name/rrd_poller/pysnmp.py", line 5, in <module>
ImportError: No module named **entity.rfc3413.oneliner**
另一个问题是为什么它指的是entity.rfc3413.oneliner而不是pysnmp.entity.rfc3413.oneliner。另外,我检查了
/usr/local/lib/python2.7/site-packages/pysnmp/entity/rfc3413/oneliner/__init__.py
这些服务器安装了两个版本的 python 一个在 /usr/bin/ 另一个在 /opt,当我这样做时:
which python
我得到:
/opt/python/python/Python-2.7.5/python # which is correct location
安装模块:
#python -c "help ('modules')"
给出:
pysnmp and pyasn1