[Python] Python doesn't see installed module entity.rfc3413.oneliner

Discussão em 'Python' iniciado por Stack, Fevereiro 24, 2025.

  1. Stack

    Stack Membro Participativo

    thank you in advance for help.

    Here is an issue, I use module pysnmp with pyasn1, I am using this example to get started, and getting an error:

    # 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**


    Other question is why it refers to entity.rfc3413.oneliner but not to pysnmp.entity.rfc3413.oneliner . Also, I checked

    /usr/local/lib/python2.7/site-packages/pysnmp/entity/rfc3413/oneliner/__init__.py


    These server has two versions of python installed one is in /usr/bin/ other in /opt, When I do:

    which python


    I get:

    /opt/python/python/Python-2.7.5/python # which is correct location


    Modules are installed:

    #python -c "help ('modules')"


    Gives:

    pysnmp and pyasn1

    Continue reading...

Compartilhe esta Página