Skip to content

ModuleNotFoundError: No module named 'pysnmp.entity.rfc3413.oneliner' #3

Description

@dixonbegay

Python version: 3.11.2

Error mesage:

Traceback (most recent call last):
  File "/home/dixon/workspace/printer-monitoring/Printer-Monitoring.py", line 30, in <module>
    from pysnmp.entity.rfc3413.oneliner import cmdgen
ModuleNotFoundError: No module named 'pysnmp.entity.rfc3413.oneliner'

I'm attempting to run in a virtual environment using venv. After activating the virtual environment, I ran pip install -r requirements.txt and I can see pysnmp installs, but the module is still not resolving. I viewed Printer-Monitoring.py in VSCode, and I see that the module isn't resolving.

Screenshot of pysnmp installing:

Image

Screenshot of the error:

Image

Activity

  1. dixonbegay commented on Jul 25, 2025

    @dixonbegay
    Author

    I resolved this by installing an additional library called pysnmplib according to answers in this stackoverflow post.

    https://stackoverflow.com/questions/19984512/python-doesnt-see-installed-module-entity-rfc3413-oneliner-due-to-name-conflict

    This resolved the issue for me and I was able to run the script.

    I watched the local modules while installing the pysnmplib module and it seems it adds the oneliner module. When only installing pysnmp, it doesn't install the oneliner module. So it seems pysnmp and pysnmplib are both required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions